minecraft-expanded-datapack/data/undeadm-m2/functions/tick.mcfunction

22 lines
995 B
Mcfunction

#take over the game?
#recipe take @a *
#gamemode adventure @a
#get day time
execute store result score $time Vtime run time query daytime
scoreboard players operation $hour Vtime = $time Vtime
scoreboard players operation $hour Vtime /= $Dhour Vtime
scoreboard players add $hour Vtime 7
execute if score $hour Vtime matches 24.. run scoreboard players remove $hour Vtime 24
# try to generate new data if missing on new villager
execute as @e[type=minecraft:villager] unless entity @s[tag=generated] run function undeadm-m2:generate_villager
# try to generate ned data if missing on wandering trader
execute as @e[type=minecraft:wandering_trader] unless entity @s[tag=generated] run function undeadm-m2:generate_wandering_trader
# lower by tick villager's talk CD
execute as @e[type=#undeadm-m2:talkable,scores={me-m2_talkCD=1..}] run scoreboard players remove @s me-m2_talkCD 1
# verb: talk
execute as @a if score @s me-core_talk matches 1.. at @s anchored eyes run function undeadm-m2:talk