Initial import
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
scoreboard players set #arena arena_reset_lock 1
|
||||
|
||||
# Karena function ini dipanggil "as @a at @s if predicate protect_villagers:allowed_dimension",
|
||||
# command clone di bawah ini berjalan di dimensi zombiiattack:protect_villagers tanpa perlu "execute in".
|
||||
|
||||
# sign
|
||||
clone 62 72 300 64 94 344 62 72 -22 replace
|
||||
|
||||
# arena war
|
||||
clone -1 62 306 60 74 338 -1 62 -16 replace
|
||||
|
||||
execute as @a at @s if predicate protect_villagers:allowed_dimension run title @s times 10 70 20
|
||||
execute as @a at @s if predicate protect_villagers:allowed_dimension run title @s title {"text":"Resetting...","color":"aqua","bold":true}
|
||||
execute as @a at @s if predicate protect_villagers:allowed_dimension run title @s subtitle [{"text":"Arena ","color":"yellow","bold":true},{"text":"Protect Villagers ","color":"green","bold":true},{"text":"telah di reset.","color":"gray"}]
|
||||
|
||||
# Volume dan pitch dibuat lebih jelas untuk seluruh player di dimensi Protect Villagers.
|
||||
execute as @a at @s if predicate protect_villagers:allowed_dimension run playsound minecraft:block.beacon.activate player @s ~ ~ ~ 2.0 1.0
|
||||
execute as @a at @s if predicate protect_villagers:allowed_dimension run playsound minecraft:block.conduit.activate player @s ~ ~ ~ 1.5 1.2
|
||||
execute as @a at @s if predicate protect_villagers:allowed_dimension run playsound minecraft:block.end_portal_frame.fill player @s ~ ~ ~ 1.2 0.8
|
||||
@@ -0,0 +1,10 @@
|
||||
scoreboard players set #villager pv_villagers 0
|
||||
scoreboard players set #guard pv_guards 0
|
||||
scoreboard players set #alive pv_alive 0
|
||||
|
||||
execute store result score #villager pv_villagers run execute if entity @e[type=minecraft:villager,x=-1,y=64,z=-9,dx=2,dy=2,dz=18]
|
||||
|
||||
execute store result score #guard pv_guards run execute if entity @e[type=guardvillagers:guard,x=-1,y=64,z=-9,dx=2,dy=2,dz=18]
|
||||
|
||||
scoreboard players operation #alive pv_alive = #villager pv_villagers
|
||||
scoreboard players operation #alive pv_alive += #guard pv_guards
|
||||
@@ -0,0 +1,6 @@
|
||||
execute store result score @s pv_emeralds run clear @s minecraft:emerald 0
|
||||
|
||||
execute if score @s pv_emeralds matches ..49 run tellraw @s [{"text":"Emerald tidak cukup. Butuh ","color":"red"},{"text":"50 Emerald","color":"green","bold":true},{"text":" untuk spawn Villager.","color":"red"}]
|
||||
execute if score @s pv_emeralds matches ..49 run playsound minecraft:block.note_block.bass player @s ~ ~ ~ 0.8 0.8
|
||||
|
||||
execute if score @s pv_emeralds matches 50.. run function protect_villagers:entities/spawn/try_slots
|
||||
@@ -0,0 +1,6 @@
|
||||
scoreboard players set #button pv_button_lock 1
|
||||
|
||||
execute if score @s pv_spawn_cd matches 1.. run tellraw @s {"text":"Villager spawn masih cooldown. Tunggu sebentar...","color":"red"}
|
||||
execute if score @s pv_spawn_cd matches 1.. run playsound minecraft:block.note_block.bass player @s ~ ~ ~ 0.8 0.7
|
||||
|
||||
execute unless score @s pv_spawn_cd matches 1.. run function protect_villagers:entities/spawn/check_payment
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 -8
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 -8 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 -8 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 -6
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 -6 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 -6 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 -4
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 -4 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 -4 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 -2
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 -2 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 -2 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 0
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 0 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 0 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 2
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 2 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 2 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 4
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 4 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 4 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 6
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 6 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 6 1.0 1.0
|
||||
@@ -0,0 +1,4 @@
|
||||
summon minecraft:villager 0 65 8
|
||||
scoreboard players set #spawn pv_spawn_done 1
|
||||
particle minecraft:happy_villager 0 66 8 0.4 0.6 0.4 0.02 20 force
|
||||
playsound minecraft:entity.villager.yes player @a[x=-39,y=57,z=-27,dx=108,dy=42,dz=54] 0 65 8 1.0 1.0
|
||||
@@ -0,0 +1,17 @@
|
||||
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
|
||||
@@ -0,0 +1,31 @@
|
||||
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
|
||||
@@ -0,0 +1 @@
|
||||
tag @a remove pv_firework_anchor
|
||||
@@ -0,0 +1,4 @@
|
||||
function protect_villagers:game/fireworks_perfect_1
|
||||
schedule function protect_villagers:game/fireworks_perfect_2 20t
|
||||
schedule function protect_villagers:game/fireworks_perfect_3 40t
|
||||
schedule function protect_villagers:game/fireworks_clear_anchor 80t
|
||||
@@ -0,0 +1,5 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 1.2 1.0
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 70 0 {LifeTime:35,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:4b,Colors:[I;15790320,16766720,11743532],FadeColors:[I;16777215],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 10 70 5 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:1b,Colors:[I;14602026,15435844,16776960],FadeColors:[I;15790320],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 20 70 -5 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:2b,Colors:[I;4312372,8073150,11743532],FadeColors:[I;16777215],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 70 8 {LifeTime:50,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:4b,Colors:[I;16777215,16766720,14602026],FadeColors:[I;15435844],Flicker:1b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,5 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 1.2 1.0
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 5 70 0 {LifeTime:35,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:1b,Colors:[I;16777215,11743532,4312372],FadeColors:[I;16766720],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 25 70 0 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:4b,Colors:[I;15790320,8073150,16766720],FadeColors:[I;16777215],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 70 -10 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:4b,Explosions:[{Type:2b,Colors:[I;14602026,15435844,16776960],FadeColors:[I;15790320],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 73 10 {LifeTime:55,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:4b,Explosions:[{Type:4b,Colors:[I;16766720,11743532,16777215],FadeColors:[I;4312372],Flicker:1b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,5 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 1.2 1.0
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 8 71 -7 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:4b,Explosions:[{Type:4b,Colors:[I;15790320,16777215,16766720],FadeColors:[I;11743532],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 22 71 7 {LifeTime:50,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:4b,Explosions:[{Type:4b,Colors:[I;11743532,4312372,8073150],FadeColors:[I;16777215],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 72 0 {LifeTime:60,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:4b,Explosions:[{Type:2b,Colors:[I;14602026,15435844,16776960,16777215],FadeColors:[I;16766720],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 75 0 {LifeTime:70,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:4b,Explosions:[{Type:4b,Colors:[I;16777215,16766720,15790320],FadeColors:[I;14602026],Flicker:1b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,4 @@
|
||||
function protect_villagers:game/fireworks_survived_1
|
||||
schedule function protect_villagers:game/fireworks_survived_2 20t
|
||||
schedule function protect_villagers:game/fireworks_survived_3 40t
|
||||
schedule function protect_villagers:game/fireworks_clear_anchor 80t
|
||||
@@ -0,0 +1,4 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 0.9 0.8
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 70 0 {LifeTime:35,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:1b,Explosions:[{Type:0b,Colors:[I;16755200,16766720,14602026],FadeColors:[I;16776960],Flicker:0b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 12 70 4 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:1b,Explosions:[{Type:1b,Colors:[I;11743532,15435844,16755200],FadeColors:[I;14602026],Flicker:0b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 18 70 -4 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:1b,Explosions:[{Type:0b,Colors:[I;14602026,16766720],FadeColors:[I;11743532],Flicker:0b,Trail:0b}]}}}}
|
||||
@@ -0,0 +1,4 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 0.9 0.8
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 10 70 -5 {LifeTime:35,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:1b,Explosions:[{Type:0b,Colors:[I;16755200,14602026,11743532],FadeColors:[I;16766720],Flicker:0b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 20 70 5 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:1b,Colors:[I;15435844,16755200,16766720],FadeColors:[I;14602026],Flicker:0b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 72 0 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:0b,Colors:[I;11743532,14602026,16755200],FadeColors:[I;16776960],Flicker:0b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,4 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 0.9 0.8
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 72 0 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:1b,Colors:[I;16755200,16766720,14602026],FadeColors:[I;11743532],Flicker:0b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 8 71 0 {LifeTime:50,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:0b,Colors:[I;15435844,11743532],FadeColors:[I;16755200],Flicker:0b,Trail:0b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 22 71 0 {LifeTime:50,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:0b,Colors:[I;14602026,16766720],FadeColors:[I;11743532],Flicker:0b,Trail:0b}]}}}}
|
||||
@@ -0,0 +1,4 @@
|
||||
function protect_villagers:game/fireworks_victory_1
|
||||
schedule function protect_villagers:game/fireworks_victory_2 20t
|
||||
schedule function protect_villagers:game/fireworks_victory_3 40t
|
||||
schedule function protect_villagers:game/fireworks_clear_anchor 80t
|
||||
@@ -0,0 +1,4 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 1.2 1.0
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 70 0 {LifeTime:35,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:1b,Colors:[I;3887386,4312372,8073150],FadeColors:[I;11250603],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 10 70 5 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:2b,Colors:[I;2437522,2651799,4312372],FadeColors:[I;3887386],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 20 70 -5 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:4b,Colors:[I;4312372,3887386,11743532],FadeColors:[I;15790320],Flicker:1b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,4 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 1.2 1.0
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 7 70 -4 {LifeTime:35,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:2b,Explosions:[{Type:1b,Colors:[I;3887386,2437522,2651799],FadeColors:[I;4312372],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 23 70 4 {LifeTime:40,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:2b,Colors:[I;4312372,8073150,11250603],FadeColors:[I;15790320],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 72 8 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:4b,Colors:[I;3887386,4312372,11743532],FadeColors:[I;8073150],Flicker:1b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,4 @@
|
||||
playsound minecraft:entity.firework_rocket.launch player @a[tag=pv_firework_anchor] ~ ~ ~ 1.2 1.0
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 15 72 0 {LifeTime:45,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:4b,Colors:[I;3887386,4312372,8073150,15790320],FadeColors:[I;11250603],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 10 72 -8 {LifeTime:50,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:1b,Colors:[I;2437522,2651799,3887386],FadeColors:[I;4312372],Flicker:1b,Trail:1b}]}}}}
|
||||
execute as @a[tag=pv_firework_anchor,limit=1] at @s if predicate protect_villagers:allowed_dimension run summon minecraft:firework_rocket 20 72 8 {LifeTime:50,FireworksItem:{id:"minecraft:firework_rocket",Count:1b,tag:{Fireworks:{Flight:3b,Explosions:[{Type:2b,Colors:[I;4312372,11743532,8073150],FadeColors:[I;15790320],Flicker:1b,Trail:1b}]}}}}
|
||||
@@ -0,0 +1,8 @@
|
||||
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 10 60 20
|
||||
|
||||
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":"A Soul Has Fallen","color":"dark_red","bold":true}
|
||||
|
||||
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 grows weaker... ","color":"gray"},{"text":"Protect the survivors!","color":"red","bold":true}]
|
||||
|
||||
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 playsound minecraft:entity.wither.spawn player @s ~ ~ ~ 0.8 1.6
|
||||
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 playsound minecraft:entity.villager.death player @s ~ ~ ~ 1.0 0.7
|
||||
@@ -0,0 +1,43 @@
|
||||
scoreboard objectives add daytime dummy
|
||||
scoreboard objectives add arena_reset_lock dummy
|
||||
|
||||
# Pastikan lock punya nilai awal supaya kondisi "matches 0" bisa lolos.
|
||||
scoreboard players set #arena arena_reset_lock 0
|
||||
|
||||
scoreboard objectives add pv_villagers dummy
|
||||
scoreboard objectives add pv_guards dummy
|
||||
scoreboard objectives add pv_alive dummy
|
||||
scoreboard objectives add pv_result_lock dummy
|
||||
|
||||
scoreboard players set #result pv_result_lock 0
|
||||
|
||||
|
||||
scoreboard objectives add pv_prev_alive dummy
|
||||
scoreboard objectives add pv_death_lock dummy
|
||||
|
||||
scoreboard players set #prev_alive pv_prev_alive 9
|
||||
scoreboard players set #death pv_death_lock 0
|
||||
|
||||
# Villager spawn button system
|
||||
scoreboard objectives add pv_spawn_cd dummy
|
||||
scoreboard objectives add pv_spawn_done dummy
|
||||
scoreboard objectives add pv_emeralds dummy
|
||||
scoreboard objectives add pv_button_lock dummy
|
||||
|
||||
scoreboard players set #spawn pv_spawn_done 0
|
||||
scoreboard players set #button pv_button_lock 0
|
||||
|
||||
scoreboard objectives add pv_sidebar_villagers dummy
|
||||
scoreboard objectives add pv_sidebar_guards dummy
|
||||
|
||||
# Protect Villagers wave visual system
|
||||
scoreboard objectives add pv_wave_lock dummy
|
||||
scoreboard objectives add pv_wave_countdown dummy
|
||||
scoreboard objectives add pv_wave_bar dummy
|
||||
scoreboard players set #wave pv_wave_lock 0
|
||||
scoreboard players set #countdown pv_wave_countdown 0
|
||||
scoreboard players set #bar pv_wave_bar 0
|
||||
bossbar add protect_villagers:wave {"text":"Protect Villagers Wave","color":"gold","bold":true}
|
||||
bossbar set protect_villagers:wave color red
|
||||
bossbar set protect_villagers:wave style progress
|
||||
bossbar set protect_villagers:wave visible false
|
||||
@@ -0,0 +1,53 @@
|
||||
# Minecraft time:
|
||||
# 06:00 = 0
|
||||
# 06:30 = 500
|
||||
# 07:00 = 1000
|
||||
# 08:00 = 2000
|
||||
|
||||
execute store result score #time daytime run time query daytime
|
||||
|
||||
# Sistem visual wave: title, countdown, dan bossbar.
|
||||
function protect_villagers:wave/tick
|
||||
|
||||
# Hitung villager dan guard villager.
|
||||
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 function protect_villagers:entities/count
|
||||
|
||||
# Kurangi cooldown spawn villager untuk player.
|
||||
scoreboard players remove @a[scores={pv_spawn_cd=1..}] pv_spawn_cd 1
|
||||
|
||||
# Button spawn villager di -10 68 0.
|
||||
# Hanya 1 player terdekat dari button yang diproses per sekali tekan.
|
||||
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] if block -10 68 0 minecraft:stone_button[powered=true] if score #button pv_button_lock matches 0 positioned -10 68 0 as @p[distance=..8] run function protect_villagers:entities/spawn/request
|
||||
|
||||
# Buka lock button lagi setelah tombol tidak powered.
|
||||
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] unless block -10 68 0 minecraft:stone_button[powered=true] run scoreboard players set #button pv_button_lock 0
|
||||
|
||||
# Deteksi jika ada villager/guard yang mati.
|
||||
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] if score #alive pv_alive < #prev_alive pv_prev_alive run function protect_villagers:game/villager_lost
|
||||
|
||||
# Simpan jumlah hidup terbaru.
|
||||
scoreboard players operation #prev_alive pv_prev_alive = #alive pv_alive
|
||||
|
||||
# Hitung emerald player setiap tick
|
||||
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] store result score @s pv_emeralds run clear @s minecraft:emerald 0
|
||||
|
||||
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 scoreboard players operation @s pv_sidebar_villagers = #villager pv_villagers
|
||||
|
||||
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 scoreboard players operation @s pv_sidebar_guards = #guard pv_guards
|
||||
|
||||
# Tampilkan actionbar hanya untuk player di arena.
|
||||
# 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 actionbar [{"text":"Villager: ","color":"yellow"},{"score":{"name":"#villager","objective":"pv_villagers"},"color":"white"},{"text":" | ","color":"gray"},{"text":"Guard Villagers: ","color":"green"},{"score":{"name":"#guard","objective":"pv_guards"},"color":"white"}]
|
||||
|
||||
# Cek hasil game jam 06:30.
|
||||
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] if score #time daytime matches 500..510 if score #result pv_result_lock matches 0 run function protect_villagers:game/check_result
|
||||
|
||||
# Reset arena jam 07:00.
|
||||
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] if score #time daytime matches 1000..1010 if score #arena arena_reset_lock matches 0 run function protect_villagers:arena/reset
|
||||
|
||||
# Buka lock hasil game setelah lewat jendela 06:30.
|
||||
execute if score #time daytime matches 511..23999 run scoreboard players set #result pv_result_lock 0
|
||||
execute if score #time daytime matches 0..499 run scoreboard players set #result pv_result_lock 0
|
||||
|
||||
# Buka lock reset arena setelah lewat jendela 07:00.
|
||||
execute if score #time daytime matches 1011..23999 run scoreboard players set #arena arena_reset_lock 0
|
||||
execute if score #time daytime matches 0..999 run scoreboard players set #arena arena_reset_lock 0
|
||||
@@ -0,0 +1,6 @@
|
||||
scoreboard players set #countdown pv_wave_countdown 180
|
||||
scoreboard players set #wave pv_wave_lock -1
|
||||
title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
title @a[tag=pv_wave_viewer] subtitle {"text":"Monster mulai spawn pukul 19:20. Bersiap!","color":"gold"}
|
||||
title @a[tag=pv_wave_viewer] title {"text":"Night Incoming","color":"red","bold":true}
|
||||
playsound minecraft:block.bell.use master @a[tag=pv_wave_viewer] -10 68 0 1 0.7
|
||||
@@ -0,0 +1,37 @@
|
||||
execute if score #countdown pv_wave_countdown matches 180 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 180 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 180 run title @a[tag=pv_wave_viewer] title {"text":"9","color":"gold","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 180 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 160 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 160 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 160 run title @a[tag=pv_wave_viewer] title {"text":"8","color":"gold","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 160 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 140 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 140 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 140 run title @a[tag=pv_wave_viewer] title {"text":"7","color":"gold","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 140 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 120 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 120 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 120 run title @a[tag=pv_wave_viewer] title {"text":"6","color":"gold","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 120 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 100 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 100 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 100 run title @a[tag=pv_wave_viewer] title {"text":"5","color":"gold","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 100 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 80 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 80 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 80 run title @a[tag=pv_wave_viewer] title {"text":"4","color":"gold","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 80 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 60 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 60 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 60 run title @a[tag=pv_wave_viewer] title {"text":"3","color":"red","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 60 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 40 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 40 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 40 run title @a[tag=pv_wave_viewer] title {"text":"2","color":"red","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 40 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
execute if score #countdown pv_wave_countdown matches 20 run title @a[tag=pv_wave_viewer] times 0 20 0
|
||||
execute if score #countdown pv_wave_countdown matches 20 run title @a[tag=pv_wave_viewer] subtitle {"text":"Siapkan villager dan guard villagers!","color":"yellow"}
|
||||
execute if score #countdown pv_wave_countdown matches 20 run title @a[tag=pv_wave_viewer] title {"text":"1","color":"red","bold":true}
|
||||
execute if score #countdown pv_wave_countdown matches 20 run playsound minecraft:block.note_block.pling master @a[tag=pv_wave_viewer] -10 68 0 1 1
|
||||
scoreboard players remove #countdown pv_wave_countdown 1
|
||||
@@ -0,0 +1,6 @@
|
||||
bossbar set protect_villagers:wave visible true
|
||||
scoreboard players operation #bar pv_wave_bar = #time daytime
|
||||
scoreboard players remove #bar pv_wave_bar 14000
|
||||
execute if score #bar pv_wave_bar matches ..0 run scoreboard players set #bar pv_wave_bar 0
|
||||
execute if score #bar pv_wave_bar matches 3500.. run scoreboard players set #bar pv_wave_bar 3500
|
||||
execute store result bossbar protect_villagers:wave value run scoreboard players get #bar pv_wave_bar
|
||||
@@ -0,0 +1,6 @@
|
||||
bossbar set protect_villagers:wave visible true
|
||||
scoreboard players operation #bar pv_wave_bar = #time daytime
|
||||
scoreboard players remove #bar pv_wave_bar 18000
|
||||
execute if score #bar pv_wave_bar matches ..0 run scoreboard players set #bar pv_wave_bar 0
|
||||
execute if score #bar pv_wave_bar matches 3667.. run scoreboard players set #bar pv_wave_bar 3667
|
||||
execute store result bossbar protect_villagers:wave value run scoreboard players get #bar pv_wave_bar
|
||||
@@ -0,0 +1,6 @@
|
||||
bossbar set protect_villagers:wave visible true
|
||||
scoreboard players operation #bar pv_wave_bar = #time daytime
|
||||
scoreboard players remove #bar pv_wave_bar 22000
|
||||
execute if score #bar pv_wave_bar matches ..0 run scoreboard players set #bar pv_wave_bar 0
|
||||
execute if score #bar pv_wave_bar matches 833.. run scoreboard players set #bar pv_wave_bar 833
|
||||
execute store result bossbar protect_villagers:wave value run scoreboard players get #bar pv_wave_bar
|
||||
@@ -0,0 +1,6 @@
|
||||
bossbar set protect_villagers:wave visible true
|
||||
scoreboard players operation #bar pv_wave_bar = #time daytime
|
||||
scoreboard players remove #bar pv_wave_bar 23000
|
||||
execute if score #bar pv_wave_bar matches ..0 run scoreboard players set #bar pv_wave_bar 0
|
||||
execute if score #bar pv_wave_bar matches 917.. run scoreboard players set #bar pv_wave_bar 917
|
||||
execute store result bossbar protect_villagers:wave value run scoreboard players get #bar pv_wave_bar
|
||||
@@ -0,0 +1,11 @@
|
||||
scoreboard players set #wave pv_wave_lock 1
|
||||
title @a[tag=pv_wave_viewer] times 10 50 10
|
||||
title @a[tag=pv_wave_viewer] subtitle {"text":"First Howl","color":"red","bold":true}
|
||||
title @a[tag=pv_wave_viewer] title {"text":"Wave 1","color":"gold","bold":true}
|
||||
playsound minecraft:entity.ender_dragon.growl master @a[tag=pv_wave_viewer] -10 68 0 0.7 1
|
||||
bossbar set protect_villagers:wave name {"text":"Wave 1 - First Howl","color":"red","bold":true}
|
||||
bossbar set protect_villagers:wave max 3500
|
||||
bossbar set protect_villagers:wave value 0
|
||||
bossbar set protect_villagers:wave color red
|
||||
bossbar set protect_villagers:wave visible true
|
||||
bossbar set protect_villagers:wave players @a[tag=pv_wave_viewer]
|
||||
@@ -0,0 +1,11 @@
|
||||
scoreboard players set #wave pv_wave_lock 2
|
||||
title @a[tag=pv_wave_viewer] times 10 50 10
|
||||
title @a[tag=pv_wave_viewer] subtitle {"text":"Midnight Siege","color":"purple","bold":true}
|
||||
title @a[tag=pv_wave_viewer] title {"text":"Wave 2","color":"gold","bold":true}
|
||||
playsound minecraft:entity.ender_dragon.growl master @a[tag=pv_wave_viewer] -10 68 0 0.7 1
|
||||
bossbar set protect_villagers:wave name {"text":"Wave 2 - Midnight Siege","color":"purple","bold":true}
|
||||
bossbar set protect_villagers:wave max 3667
|
||||
bossbar set protect_villagers:wave value 0
|
||||
bossbar set protect_villagers:wave color purple
|
||||
bossbar set protect_villagers:wave visible true
|
||||
bossbar set protect_villagers:wave players @a[tag=pv_wave_viewer]
|
||||
@@ -0,0 +1,11 @@
|
||||
scoreboard players set #wave pv_wave_lock 3
|
||||
title @a[tag=pv_wave_viewer] times 10 50 10
|
||||
title @a[tag=pv_wave_viewer] subtitle {"text":"Dead Hour","color":"blue","bold":true}
|
||||
title @a[tag=pv_wave_viewer] title {"text":"Wave 3","color":"gold","bold":true}
|
||||
playsound minecraft:entity.ender_dragon.growl master @a[tag=pv_wave_viewer] -10 68 0 0.7 1
|
||||
bossbar set protect_villagers:wave name {"text":"Wave 3 - Dead Hour","color":"blue","bold":true}
|
||||
bossbar set protect_villagers:wave max 833
|
||||
bossbar set protect_villagers:wave value 0
|
||||
bossbar set protect_villagers:wave color purple
|
||||
bossbar set protect_villagers:wave visible true
|
||||
bossbar set protect_villagers:wave players @a[tag=pv_wave_viewer]
|
||||
@@ -0,0 +1,11 @@
|
||||
scoreboard players set #wave pv_wave_lock 4
|
||||
title @a[tag=pv_wave_viewer] times 10 50 10
|
||||
title @a[tag=pv_wave_viewer] subtitle {"text":"Dawn Breaker","color":"yellow","bold":true}
|
||||
title @a[tag=pv_wave_viewer] title {"text":"Wave 4","color":"gold","bold":true}
|
||||
playsound minecraft:entity.ender_dragon.growl master @a[tag=pv_wave_viewer] -10 68 0 0.7 1
|
||||
bossbar set protect_villagers:wave name {"text":"Wave 4 - Dawn Breaker","color":"yellow","bold":true}
|
||||
bossbar set protect_villagers:wave max 917
|
||||
bossbar set protect_villagers:wave value 0
|
||||
bossbar set protect_villagers:wave color yellow
|
||||
bossbar set protect_villagers:wave visible true
|
||||
bossbar set protect_villagers:wave players @a[tag=pv_wave_viewer]
|
||||
@@ -0,0 +1,33 @@
|
||||
# Tandai player yang sedang berada di arena Protect Villagers.
|
||||
# Ini lebih aman untuk custom dimension, karena pengecekan area dilakukan dari posisi player sendiri.
|
||||
tag @a remove pv_wave_viewer
|
||||
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_wave_viewer
|
||||
|
||||
# Update target player bossbar hanya untuk player di arena.
|
||||
bossbar set protect_villagers:wave players @a[tag=pv_wave_viewer]
|
||||
|
||||
# Countdown persiapan 9 detik sebelum monster mulai spawn sekitar 19:20.
|
||||
execute if score #time daytime matches 13153..13333 if score #countdown pv_wave_countdown matches 0 if score #wave pv_wave_lock matches 0 run function protect_villagers:wave/countdown/start
|
||||
execute if score #countdown pv_wave_countdown matches 1.. run function protect_villagers:wave/countdown/tick
|
||||
|
||||
# Trigger title wave. Jika server /reload atau player masuk saat wave sudah berjalan, sistem tetap recover.
|
||||
execute if score #time daytime matches 14000..17500 unless score #wave pv_wave_lock matches 1 run function protect_villagers:wave/start/wave_1
|
||||
execute if score #time daytime matches 18000..21667 unless score #wave pv_wave_lock matches 2 run function protect_villagers:wave/start/wave_2
|
||||
execute if score #time daytime matches 22000..22833 unless score #wave pv_wave_lock matches 3 run function protect_villagers:wave/start/wave_3
|
||||
execute if score #time daytime matches 23000..23917 unless score #wave pv_wave_lock matches 4 run function protect_villagers:wave/start/wave_4
|
||||
|
||||
# Progress bossbar aktif sesuai rentang wave.
|
||||
execute if score #time daytime matches 14000..17500 run function protect_villagers:wave/progress/wave_1
|
||||
execute if score #time daytime matches 18000..21667 run function protect_villagers:wave/progress/wave_2
|
||||
execute if score #time daytime matches 22000..22833 run function protect_villagers:wave/progress/wave_3
|
||||
execute if score #time daytime matches 23000..23917 run function protect_villagers:wave/progress/wave_4
|
||||
|
||||
# Sembunyikan bossbar ketika sedang jeda antar wave.
|
||||
execute if score #time daytime matches 17501..17999 run bossbar set protect_villagers:wave visible false
|
||||
execute if score #time daytime matches 21668..21999 run bossbar set protect_villagers:wave visible false
|
||||
execute if score #time daytime matches 22834..22999 run bossbar set protect_villagers:wave visible false
|
||||
execute if score #time daytime matches 23918..23999 run bossbar set protect_villagers:wave visible false
|
||||
execute if score #time daytime matches 0..13999 run bossbar set protect_villagers:wave visible false
|
||||
|
||||
# Reset harian sebelum malam berikutnya.
|
||||
execute if score #time daytime matches 12000..13000 if score #wave pv_wave_lock matches 4 run scoreboard players set #wave pv_wave_lock 0
|
||||
Reference in New Issue
Block a user