scoreboard players set #result pv_result_lock 1 function protect_villagers:entities/count # Pakai player di arena sebagai anchor supaya fireworks terjadwal tetap muncul di dimensi protect_villagers. tag @a remove pv_firework_anchor execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run tag @s add pv_firework_anchor execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s times 20 140 60 execute if score #alive pv_alive matches 9.. run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s title {"text":"Perfect Victory!","color":"aqua","bold":true} execute if score #alive pv_alive matches 9.. run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s subtitle [{"text":"Every villager survived. ","color":"white"},{"text":"Legendary defense!","color":"gold","bold":true}] execute if score #alive pv_alive matches 7..8 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s title {"text":"Victory!","color":"green","bold":true} execute if score #alive pv_alive matches 7..8 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s subtitle [{"text":"The village stands. ","color":"yellow"},{"text":"Your defense held!","color":"green","bold":true}] execute if score #alive pv_alive matches 5..6 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s title {"text":"Survived!","color":"yellow","bold":true} execute if score #alive pv_alive matches 5..6 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s subtitle [{"text":"Barely alive... ","color":"gold"},{"text":"but the village endures.","color":"gray"}] execute if score #alive pv_alive matches ..4 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s title {"text":"Defeat!","color":"red","bold":true} execute if score #alive pv_alive matches ..4 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run title @s subtitle [{"text":"Too many villagers have fallen.","color":"dark_red"}] execute if score #alive pv_alive matches 9.. run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run give @s minecraft:diamond 3 execute if score #alive pv_alive matches 7..8 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run give @s minecraft:emerald 8 execute if score #alive pv_alive matches 5..6 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run give @s minecraft:emerald 4 execute if score #alive pv_alive matches ..4 run execute as @a at @s if predicate protect_villagers:allowed_dimension if entity @s[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] run give @s minecraft:bread 3 execute if score #alive pv_alive matches 9.. run function protect_villagers:game/fireworks_perfect execute if score #alive pv_alive matches 7..8 run function protect_villagers:game/fireworks_victory execute if score #alive pv_alive matches 5..6 run function protect_villagers:game/fireworks_survived execute if score #alive pv_alive matches ..4 run playsound minecraft:entity.wither.death player @a[tag=pv_firework_anchor] ~ ~ ~ 0.8 0.7