Files
zombiiattack-datapack/data/protect_villagers/functions/entities/spawn/try_slots.mcfunction
T
Darto KLoning 0a22196ea6 Initial import
2026-06-20 20:58:13 +07:00

17 lines
2.7 KiB
MCFunction

scoreboard players set #spawn pv_spawn_done 0
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 -8 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_1
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 -6 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_2
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 -4 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_3
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 -2 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_4
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 0 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_5
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 2 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_6
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 4 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_7
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 6 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_8
execute if score #spawn pv_spawn_done matches 0 positioned 0 65 8 unless entity @e[type=minecraft:villager,distance=..0.8] unless entity @e[type=guardvillagers:guard,distance=..0.8] run function protect_villagers:entities/spawn/slot_9
execute if score #spawn pv_spawn_done matches 0 run tellraw @s {"text":"Semua slot Villager sudah terisi.","color":"yellow"}
execute if score #spawn pv_spawn_done matches 1 run clear @s minecraft:emerald 50
execute if score #spawn pv_spawn_done matches 1 run scoreboard players set @s pv_spawn_cd 300
execute if score #spawn pv_spawn_done matches 1 run tellraw @s [{"text":"Villager baru berhasil dipanggil. ","color":"green"},{"text":"-50 Emerald","color":"yellow"}]
execute if score #spawn pv_spawn_done matches 1 run playsound minecraft:entity.villager.celebrate player @s ~ ~ ~ 1.2 1.0