Initial import

This commit is contained in:
Darto KLoning
2026-06-20 20:58:13 +07:00
parent 2d6b7400a2
commit 0a22196ea6
76 changed files with 1019 additions and 0 deletions
@@ -0,0 +1,5 @@
# Runs periodically so newly joined players receive recipes,
# but each player is granted recipes only once to avoid packet spam.
schedule function allrecipes:load 10s replace
execute as @a[tag=!allrecipes_given] run recipe give @s *
tag @a[tag=!allrecipes_given] add allrecipes_given
@@ -0,0 +1,5 @@
execute as @a at @s run tag @e[type=minecraft:armor_stand,distance=..4,tag=!zombiiattack_armorstand] add zombiiattack_armorstand
execute as @e[type=minecraft:armor_stand,tag=zombiiattack_armorstand,tag=!zombiiattack_armorstand_arm] run data merge entity @s {ShowArms:1b}
execute as @e[type=minecraft:armor_stand,tag=zombiiattack_armorstand,tag=!zombiiattack_armorstand_arm] run tag @s add zombiiattack_armorstand_arm
+1
View File
@@ -0,0 +1 @@
gamerule playersSleepingPercentage 1
@@ -0,0 +1,65 @@
{
"type": "guardvillagers:slot",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "lrarmor:defender_helmet"
}
],
"functions": [
{
"function": "guardvillagers:slot",
"slot": "head"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "lrarmor:defender_chestplate"
}
],
"functions": [
{
"function": "guardvillagers:slot",
"slot": "chest"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "lrarmor:defender_leggings"
}
],
"functions": [
{
"function": "guardvillagers:slot",
"slot": "legs"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "lrarmor:defender_boots"
}
],
"functions": [
{
"function": "guardvillagers:slot",
"slot": "feet"
}
]
}
]
}
@@ -0,0 +1,14 @@
scoreboard players add @s homingloot_count 1
execute if score @s homingloot_count matches 20 run data remove entity @s Motion
execute if score @s homingloot_count matches 20 run data modify entity @s NoGravity set value 1b
execute if score @s homingloot_count matches 20.. run particle dust_color_transition 0.000 1.000 0.000 1 0.031 0.451 1.000 ~ ~ ~ 0 0 0 1 0 force @a[distance=..96]
execute if score @s homingloot_count matches 20.. at @s run tp @s ^ ^ ^0.25 facing entity @p[gamemode=!spectator,distance=..96] feet
execute if score @s homingloot_count matches 20.. at @s run tp @s ^ ^ ^0.25 facing entity @p[gamemode=!spectator,distance=..96] feet
execute if score @s homingloot_count matches 30.. run particle dust_color_transition 0.000 1.000 0.000 1 1.000 1.000 1.000 ~ ~ ~ 0 0 0 1 0 force @a[distance=..96]
execute if score @s homingloot_count matches 30.. at @s run tp @s ^ ^ ^0.30 facing entity @p[gamemode=!spectator,distance=..96] feet
execute if score @s homingloot_count matches 30.. at @s run tp @s ^ ^ ^0.30 facing entity @p[gamemode=!spectator,distance=..96] feet
@@ -0,0 +1 @@
scoreboard objectives add homingloot_count dummy
+14
View File
@@ -0,0 +1,14 @@
scoreboard players add @s homingloot_count 1
execute if score @s homingloot_count matches 20 run data remove entity @s Motion
execute if score @s homingloot_count matches 20 run data modify entity @s NoGravity set value 1b
execute if score @s homingloot_count matches 20.. run particle dust_color_transition 0.969 1.000 0.000 1 0.031 0.451 1.000 ~ ~ ~ 0 0 0 1 0 force @a[distance=..96]
execute if score @s homingloot_count matches 20.. at @s run tp @s ^ ^ ^.3 facing entity @p[gamemode=!spectator,distance=..96] feet
execute if score @s homingloot_count matches 20.. at @s run tp @s ^ ^ ^.3 facing entity @p[gamemode=!spectator,distance=..96] feet
execute if score @s homingloot_count matches 30.. run particle dust_color_transition 0.969 1.000 0.000 1 0.031 0.451 1.000 ~ ~ ~ 0 0 0 1 0 force @a[distance=..96]
execute if score @s homingloot_count matches 30.. at @s run tp @s ^ ^ ^.3 facing entity @p[gamemode=!spectator,distance=..96] feet
execute if score @s homingloot_count matches 30.. at @s run tp @s ^ ^ ^.3 facing entity @p[gamemode=!spectator,distance=..96] feet
@@ -0,0 +1,2 @@
execute as @e[type=minecraft:experience_orb] at @s run function homingloot:orb
execute in zombiiattack:protect_villagers as @e[type=minecraft:item,nbt={Item:{id:"minecraft:emerald"}}] at @s if predicate homingloot:allowed_dimension run function homingloot:emerald
@@ -0,0 +1,6 @@
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:protect_villagers"
}
}
+5
View File
@@ -0,0 +1,5 @@
say §9============================================
say §d§lKLoningSpoon §7presents:
say §a§lZombii§b§lAttack §7- §c§lGames §7§lof §e§lThe Apocalypse
say §3§lDatapacks §8§lversion: §6§l2026.06.20.1914
say §9============================================
+15
View File
@@ -0,0 +1,15 @@
# Lobby effects
# Logic:
# - Effect lobby diberikan hanya 1x saat player masuk lobby.
# - Durasi dibuat sangat panjang supaya icon effect tidak refresh/berkedip terus.
# - Saat player keluar lobby, effect lobby dibersihkan 1x lalu tag dihapus.
# Player baru masuk lobby: beri semua effect lobby sekali saja.
execute as @a[tag=!lobby_effects] at @s if predicate lobby:allowed_dimension run effect give @s minecraft:saturation infinite 2 true
execute as @a[tag=!lobby_effects] at @s if predicate lobby:allowed_dimension run effect give @a minecraft:instant_health infinite 2 true
execute as @a[tag=!lobby_effects] at @s if predicate lobby:allowed_dimension run tag @s add lobby_effects
# Saat player sudah bukan di lobby, bersihkan effect lobby sekali lalu hapus tag.
execute as @a[tag=lobby_effects] at @s unless predicate lobby:allowed_dimension run effect clear @s minecraft:saturation
execute as @a[tag=lobby_effects] at @s unless predicate lobby:allowed_dimension run effect clear @s minecraft:instant_health
execute as @a[tag=lobby_effects] at @s unless predicate lobby:allowed_dimension run tag @s remove lobby_effects
@@ -0,0 +1,6 @@
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:lobby"
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"values": [
"homingloot:load",
"info:load",
"xaerominimap:load",
"allrecipes:load",
"gamerules:load",
"mobcaptains:load",
"protect_villagers:load",
"nof3:load"
]
}
+10
View File
@@ -0,0 +1,10 @@
{
"replace": false,
"values": [
"homingloot:tick",
"trashslot:tick",
"lobby:tick",
"armorstand:tick",
"protect_villagers:tick"
]
}
@@ -0,0 +1,3 @@
scoreboard players set .notify_on_spawn ps-mob.config 0
scoreboard players set .notify_with_sound ps-mob.config 0
scoreboard players set .beam_on_spawn ps-mob.config 0
+1
View File
@@ -0,0 +1 @@
gamerule reducedDebugInfo true
@@ -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
@@ -0,0 +1,6 @@
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:protect_villagers"
}
}
@@ -0,0 +1,109 @@
# Cari slot kosong pertama, lalu salin item dari inventory.26 ke slot tersebut.
# Patch: ts_moved hanya dipasang jika command item replace benar-benar sukses,
# bukan sekadar karena slot target terdeteksi berisi item. Ini mencegah false-positive
# yang membuat actionbar muncul tetapi item asli kemudian hilang.
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:9b}] store success score @s trashslot_success run item replace entity @s inventory.0 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:10b}] store success score @s trashslot_success run item replace entity @s inventory.1 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:11b}] store success score @s trashslot_success run item replace entity @s inventory.2 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:12b}] store success score @s trashslot_success run item replace entity @s inventory.3 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:13b}] store success score @s trashslot_success run item replace entity @s inventory.4 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:14b}] store success score @s trashslot_success run item replace entity @s inventory.5 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:15b}] store success score @s trashslot_success run item replace entity @s inventory.6 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:16b}] store success score @s trashslot_success run item replace entity @s inventory.7 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:17b}] store success score @s trashslot_success run item replace entity @s inventory.8 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:18b}] store success score @s trashslot_success run item replace entity @s inventory.9 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:19b}] store success score @s trashslot_success run item replace entity @s inventory.10 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:20b}] store success score @s trashslot_success run item replace entity @s inventory.11 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:21b}] store success score @s trashslot_success run item replace entity @s inventory.12 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:22b}] store success score @s trashslot_success run item replace entity @s inventory.13 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:23b}] store success score @s trashslot_success run item replace entity @s inventory.14 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:24b}] store success score @s trashslot_success run item replace entity @s inventory.15 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:25b}] store success score @s trashslot_success run item replace entity @s inventory.16 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:26b}] store success score @s trashslot_success run item replace entity @s inventory.17 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:27b}] store success score @s trashslot_success run item replace entity @s inventory.18 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:28b}] store success score @s trashslot_success run item replace entity @s inventory.19 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:29b}] store success score @s trashslot_success run item replace entity @s inventory.20 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:30b}] store success score @s trashslot_success run item replace entity @s inventory.21 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:31b}] store success score @s trashslot_success run item replace entity @s inventory.22 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:32b}] store success score @s trashslot_success run item replace entity @s inventory.23 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:33b}] store success score @s trashslot_success run item replace entity @s inventory.24 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:34b}] store success score @s trashslot_success run item replace entity @s inventory.25 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:0b}] store success score @s trashslot_success run item replace entity @s hotbar.0 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:1b}] store success score @s trashslot_success run item replace entity @s hotbar.1 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:2b}] store success score @s trashslot_success run item replace entity @s hotbar.2 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:3b}] store success score @s trashslot_success run item replace entity @s hotbar.3 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:4b}] store success score @s trashslot_success run item replace entity @s hotbar.4 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:5b}] store success score @s trashslot_success run item replace entity @s hotbar.5 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:6b}] store success score @s trashslot_success run item replace entity @s hotbar.6 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:7b}] store success score @s trashslot_success run item replace entity @s hotbar.7 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
execute unless entity @s[tag=ts_moved] unless data entity @s Inventory[{Slot:8b}] store success score @s trashslot_success run item replace entity @s hotbar.8 from entity @s inventory.26
execute unless entity @s[tag=ts_moved] if score @s trashslot_success matches 1.. run tag @s add ts_moved
scoreboard players set @s[tag=!ts_moved] trashslot_success 0
@@ -0,0 +1,20 @@
# Simpan jumlah item sebelum slot 26 dikosongkan.
execute store result score @s trashslot_count run data get entity @s Inventory[{Slot:35b}].Count
# Flag internal agar item hanya dipindahkan satu kali.
scoreboard players set @s trashslot_success 0
tag @s remove ts_moved
tag @s remove ts_slot26_protected
# Coba pindahkan item dari slot 26 ke slot kosong pertama.
function trashslot:move_slot_26_to_empty
# Beri pesan jika berhasil. Nama item ditampilkan sebagai item id agar selalu muncul, termasuk item tanpa custom name.
execute if entity @s[tag=ts_moved] run title @s actionbar [{"score":{"name":"@s","objective":"trashslot_count"}},{"text":" "},{"nbt":"Inventory[{Slot:35b}].id","entity":"@s"},{"text":" telah dipindahkan.","color":"green"}]
# Kosongkan slot 26 setelah item berhasil disalin ke slot kosong.
execute if entity @s[tag=ts_moved] run item replace entity @s inventory.26 with air
# Kalau inventory penuh, jangan timpa item. Trash Slot akan aktif setelah player mengosongkan/memindahkan slot 26.
execute unless entity @s[tag=ts_moved] run tag @s add ts_slot26_protected
execute unless entity @s[tag=ts_moved] run title @s actionbar {"text":"Trash Slot belum aktif: inventory penuh, item di slot 26 tidak dipindahkan.","color":"red"}
+41
View File
@@ -0,0 +1,41 @@
# Objective untuk menampilkan jumlah item yang dipindahkan dari slot 26.
# Aman walaupun dijalankan berulang; jika objective sudah ada, command ini hanya gagal diam-diam.
scoreboard objectives add trashslot_count dummy
scoreboard objectives add trashslot_success dummy
# Tandai player yang sedang berada di mode bebas.
# Tag ini dipakai untuk mendeteksi transisi dari creative/spectator ke survival/adventure.
tag @a[gamemode=creative] add ts_free_mode
tag @a[gamemode=spectator] add ts_free_mode
tag @a[gamemode=creative] remove ts_transition_checked
tag @a[gamemode=spectator] remove ts_transition_checked
tag @a[gamemode=creative] remove ts_slot26_protected
tag @a[gamemode=spectator] remove ts_slot26_protected
# Hapus hanya icon Trash Slot saat player masuk creative/spectator.
# Jangan pakai item replace inventory.26 with air tanpa kondisi, karena itu akan
# menghapus item apa pun yang ditaruh player di slot 26 setiap tick.
clear @a[gamemode=creative] minecraft:barrier{CustomModelData:87274} 1
clear @a[gamemode=spectator] minecraft:barrier{CustomModelData:87274} 1
# Bersihkan item trash lama dari player survival/adventure.
clear @a[gamemode=!creative,gamemode=!spectator] minecraft:barrier{CustomModelData:87274}
# Saat baru pindah dari creative/spectator ke survival/adventure, selamatkan item asli di slot 26 satu kali saja.
# NBT Slot 35b = command slot inventory.26.
execute as @a[gamemode=!creative,gamemode=!spectator,tag=ts_free_mode,tag=!ts_transition_checked] at @s if predicate trashslot:allowed_dimension if data entity @s Inventory[{Slot:35b}] unless data entity @s Inventory[{Slot:35b,id:"minecraft:barrier",tag:{CustomModelData:87274}}] run function trashslot:save_slot_26
tag @a[gamemode=!creative,gamemode=!spectator,tag=ts_free_mode,tag=!ts_transition_checked] add ts_transition_checked
tag @a[gamemode=!creative,gamemode=!spectator,tag=ts_free_mode,tag=ts_transition_checked] remove ts_free_mode
# Jika player survival/adventure memang membuang item ke slot 26 saat Trash Slot aktif, hapus diam-diam.
# Ini tidak menampilkan actionbar, dan tidak menjalankan fungsi pemindahan item.
execute as @a[gamemode=!creative,gamemode=!spectator,tag=!ts_slot26_protected] at @s if predicate trashslot:allowed_dimension if data entity @s Inventory[{Slot:35b}] unless data entity @s Inventory[{Slot:35b,id:"minecraft:barrier",tag:{CustomModelData:87274}}] run item replace entity @s inventory.26 with air
# Jika sebelumnya slot 26 dilindungi karena inventory penuh, lepaskan proteksi setelah slot 26 kosong.
execute as @a[gamemode=!creative,gamemode=!spectator,tag=ts_slot26_protected] unless data entity @s Inventory[{Slot:35b}] run tag @s remove ts_slot26_protected
# Pasang trash slot hanya kalau slot 26 kosong, supaya item asli tidak tertimpa.
execute as @a[gamemode=!creative,gamemode=!spectator] at @s if predicate trashslot:allowed_dimension unless data entity @s Inventory[{Slot:35b}] run item replace entity @s inventory.26 with minecraft:barrier{CustomModelData:87274,HideFlags:32,display:{Name:'{"text":"Trash Slot","color":"dark_red","italic":false}',Lore:['{"text":"ZombiiAttack","color":"gray","italic":true}']}}
# Hancurkan item trash yang terlempar ke world jika berupa item icon Trash Slot.
kill @e[type=item,nbt={Item:{tag:{display:{Name:'{"extra":[{"italic":false,"color":"dark_red","text":"Trash Slot"}],"text":""}'}}}}]
@@ -0,0 +1,47 @@
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:overworld"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:the_nether"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:the_end"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:csgo"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:protect_villagers"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:saving_ryan"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:the_labyrinth"
}
}
]
}
@@ -0,0 +1,8 @@
schedule function xaerominimap:load 20t replace
# Bypass: player dengan tag xaero_bypass selalu boleh memakai minimap di semua dimensi.
execute as @a[tag=xaero_bypass] run effect clear @s xaerominimap:no_minimap
# Non-bypass: minimap hanya boleh aktif di dimensi yang masuk predicate allowed_dimension.
execute as @a[tag=!xaero_bypass] at @s if predicate xaerominimap:allowed_dimension run effect clear @s xaerominimap:no_minimap
execute as @a[tag=!xaero_bypass] at @s unless predicate xaerominimap:allowed_dimension run effect give @s xaerominimap:no_minimap 3 0 true
@@ -0,0 +1,35 @@
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:overworld"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:the_nether"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:the_end"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:csgo"
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "zombiiattack:saving_ryan"
}
}
]
}
+11
View File
@@ -0,0 +1,11 @@
{
"type": "zombiiattack:creative",
"generator": {
"type": "minecraft:noise",
"settings": "minecraft:overworld",
"biome_source": {
"type": "minecraft:multi_noise",
"preset": "minecraft:overworld"
}
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"type": "zombiiattack:arena",
"generator": {
"type": "minecraft:flat",
"settings": {
"biome": "minecraft:plains",
"features": false,
"lakes": false,
"layers": [],
"structure_overrides": []
}
}
}
+18
View File
@@ -0,0 +1,18 @@
{
"type": "zombiiattack:lobby",
"generator": {
"type": "minecraft:flat",
"settings": {
"biome": "minecraft:plains",
"features": false,
"lakes": false,
"structure_overrides": [],
"layers": [
{
"block": "minecraft:air",
"height": 1
}
]
}
}
}
@@ -0,0 +1,13 @@
{
"type": "zombiiattack:arena",
"generator": {
"type": "minecraft:flat",
"settings": {
"biome": "minecraft:plains",
"features": false,
"lakes": false,
"layers": [],
"structure_overrides": []
}
}
}
@@ -0,0 +1,13 @@
{
"type": "zombiiattack:arena",
"generator": {
"type": "minecraft:flat",
"settings": {
"biome": "minecraft:plains",
"features": false,
"lakes": false,
"layers": [],
"structure_overrides": []
}
}
}
@@ -0,0 +1,13 @@
{
"type": "zombiiattack:arena",
"generator": {
"type": "minecraft:flat",
"settings": {
"biome": "minecraft:plains",
"features": false,
"lakes": false,
"layers": [],
"structure_overrides": []
}
}
}
@@ -0,0 +1,25 @@
{
"ultrawarm": false,
"natural": true,
"coordinate_scale": 1.0,
"piglin_safe": false,
"respawn_anchor_works": false,
"bed_works": true,
"has_raids": true,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.0,
"logical_height": 384,
"infiniburn": "#minecraft:infiniburn_overworld",
"effects": "minecraft:overworld",
"min_y": -64,
"height": 384,
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"min_inclusive": 0,
"max_inclusive": 7
}
},
"monster_spawn_block_light_limit": 0
}
@@ -0,0 +1,25 @@
{
"ultrawarm": false,
"natural": true,
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.0,
"piglin_safe": false,
"bed_works": true,
"respawn_anchor_works": false,
"has_raids": true,
"logical_height": 384,
"min_y": -64,
"height": 384,
"infiniburn": "#minecraft:infiniburn_overworld",
"effects": "minecraft:overworld",
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"min_inclusive": 0,
"max_inclusive": 7
}
},
"monster_spawn_block_light_limit": 0
}
@@ -0,0 +1,26 @@
{
"ultrawarm": false,
"natural": false,
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.0,
"fixed_time": 6000,
"piglin_safe": true,
"bed_works": false,
"respawn_anchor_works": false,
"has_raids": false,
"logical_height": 384,
"min_y": -64,
"height": 384,
"infiniburn": "#minecraft:infiniburn_overworld",
"effects": "minecraft:overworld",
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"min_inclusive": 0,
"max_inclusive": 0
}
},
"monster_spawn_block_light_limit": 0
}