From 95d84428637e8ade352bc41309683417c016cc80 Mon Sep 17 00:00:00 2001 From: Ponpon Date: Sat, 4 Oct 2025 22:05:56 +0900 Subject: [PATCH 1/3] GH-913 Add reboot_spawner --- .../advancement/spawn_eggs_to_spawner.json | 115 ++++++++++++++++++ .../reboot_spawner/interact.mcfunction | 6 + .../function/reboot_spawner/reboot.mcfunction | 3 + .../function/reboot_spawner/search.mcfunction | 4 + 4 files changed, 128 insertions(+) create mode 100644 data/enemy/advancement/spawn_eggs_to_spawner.json create mode 100644 data/enemy/function/reboot_spawner/interact.mcfunction create mode 100644 data/enemy/function/reboot_spawner/reboot.mcfunction create mode 100644 data/enemy/function/reboot_spawner/search.mcfunction diff --git a/data/enemy/advancement/spawn_eggs_to_spawner.json b/data/enemy/advancement/spawn_eggs_to_spawner.json new file mode 100644 index 0000000000..2a5e2265a5 --- /dev/null +++ b/data/enemy/advancement/spawn_eggs_to_spawner.json @@ -0,0 +1,115 @@ +{ + "criteria": { + "use_spawn_eggs": { + "trigger": "item_used_on_block", + "conditions": { + "location": [ + { + "condition": "match_tool", + "predicate": { + "items": [ + "bat_spawn_egg", + "bee_spawn_egg", + "cat_spawn_egg", + "cod_spawn_egg", + "cow_spawn_egg", + "fox_spawn_egg", + "pig_spawn_egg", + "vex_spawn_egg", + "frog_spawn_egg", + "goat_spawn_egg", + "husk_spawn_egg", + "mule_spawn_egg", + "wolf_spawn_egg", + "allay_spawn_egg", + "blaze_spawn_egg", + "ghast_spawn_egg", + "horse_spawn_egg", + "llama_spawn_egg", + "panda_spawn_egg", + "sheep_spawn_egg", + "slime_spawn_egg", + "squid_spawn_egg", + "stray_spawn_egg", + "witch_spawn_egg", + "donkey_spawn_egg", + "evoker_spawn_egg", + "hoglin_spawn_egg", + "ocelot_spawn_egg", + "parrot_spawn_egg", + "piglin_spawn_egg", + "rabbit_spawn_egg", + "salmon_spawn_egg", + "spider_spawn_egg", + "turtle_spawn_egg", + "warden_spawn_egg", + "wither_spawn_egg", + "zoglin_spawn_egg", + "zombie_spawn_egg", + "axolotl_spawn_egg", + "chicken_spawn_egg", + "creeper_spawn_egg", + "dolphin_spawn_egg", + "drowned_spawn_egg", + "phantom_spawn_egg", + "ravager_spawn_egg", + "shulker_spawn_egg", + "strider_spawn_egg", + "tadpole_spawn_egg", + "enderman_spawn_egg", + "guardian_spawn_egg", + "pillager_spawn_egg", + "skeleton_spawn_egg", + "villager_spawn_egg", + "endermite_spawn_egg", + "mooshroom_spawn_egg", + "glow_squid_spawn_egg", + "iron_golem_spawn_egg", + "magma_cube_spawn_egg", + "polar_bear_spawn_egg", + "pufferfish_spawn_egg", + "silverfish_spawn_egg", + "snow_golem_spawn_egg", + "vindicator_spawn_egg", + "cave_spider_spawn_egg", + "ender_dragon_spawn_egg", + "piglin_brute_spawn_egg", + "trader_llama_spawn_egg", + "zombie_horse_spawn_egg", + "tropical_fish_spawn_egg", + "elder_guardian_spawn_egg", + "skeleton_horse_spawn_egg", + "wither_skeleton_spawn_egg", + "zombie_villager_spawn_egg", + "wandering_trader_spawn_egg", + "zombified_piglin_spawn_egg", + "breeze_spawn_egg", + "camel_spawn_egg", + "sniffer_spawn_egg", + "zombified_piglin_spawn_egg" + ] + } + }, + { + "condition": "location_check", + "predicate": { + "block": { + "blocks": [ + "spawner" + ] + } + } + } + ] + } + } + }, + "requirements": [ + [ + "use_spawn_eggs" + ] + ], + "rewards": { + "function": "enemy:reboot_spawner/interact" + } +} \ No newline at end of file diff --git a/data/enemy/function/reboot_spawner/interact.mcfunction b/data/enemy/function/reboot_spawner/interact.mcfunction new file mode 100644 index 0000000000..f36327aad2 --- /dev/null +++ b/data/enemy/function/reboot_spawner/interact.mcfunction @@ -0,0 +1,6 @@ +#探索距離7ブロック +scoreboard players set _ _ 70 +#視線先のスポナーを探索 +execute anchored eyes positioned ^ ^ ^ anchored feet run function enemy:reboot_spawner/search +#トリガー解除 +advancement revoke @s only enemy:spawn_eggs_to_spawner diff --git a/data/enemy/function/reboot_spawner/reboot.mcfunction b/data/enemy/function/reboot_spawner/reboot.mcfunction new file mode 100644 index 0000000000..4a5f4f0812 --- /dev/null +++ b/data/enemy/function/reboot_spawner/reboot.mcfunction @@ -0,0 +1,3 @@ + +execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnData.entity.id set from entity @s item.tag.Spawner.SpawnData.entity.id +execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnPotentials[0].data.entity.id set from entity @s item.tag.Spawner.SpawnPotentials[0].data.entity.id diff --git a/data/enemy/function/reboot_spawner/search.mcfunction b/data/enemy/function/reboot_spawner/search.mcfunction new file mode 100644 index 0000000000..3178f30e54 --- /dev/null +++ b/data/enemy/function/reboot_spawner/search.mcfunction @@ -0,0 +1,4 @@ +#視線先のスポナーを探索 +scoreboard players remove _ _ 1 +execute if score _ _ matches 1.. unless block ^ ^ ^ spawner positioned ^ ^ ^0.1 run function enemy:reboot_spawner/search +execute if block ^ ^ ^ spawner align xyz positioned ~0.5 ~0.5 ~0.5 run function enemy:reboot_spawner/reboot From 0a5f2b16e032aa787305e73e6c16862df70825ab Mon Sep 17 00:00:00 2001 From: Ponpon Date: Sat, 4 Oct 2025 22:12:17 +0900 Subject: [PATCH 2/3] =?UTF-8?q?NO-ISSUE=20Refactor=20=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=83=98=E3=83=83=E3=83=80=E3=81=AB=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/enemy/advancement/spawn_eggs_to_spawner.json | 2 +- data/enemy/function/reboot_spawner/interact.mcfunction | 1 + data/enemy/function/reboot_spawner/reboot.mcfunction | 2 +- data/enemy/function/reboot_spawner/search.mcfunction | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/enemy/advancement/spawn_eggs_to_spawner.json b/data/enemy/advancement/spawn_eggs_to_spawner.json index 2a5e2265a5..121157e84a 100644 --- a/data/enemy/advancement/spawn_eggs_to_spawner.json +++ b/data/enemy/advancement/spawn_eggs_to_spawner.json @@ -112,4 +112,4 @@ "rewards": { "function": "enemy:reboot_spawner/interact" } -} \ No newline at end of file +} diff --git a/data/enemy/function/reboot_spawner/interact.mcfunction b/data/enemy/function/reboot_spawner/interact.mcfunction index f36327aad2..25034bad9a 100644 --- a/data/enemy/function/reboot_spawner/interact.mcfunction +++ b/data/enemy/function/reboot_spawner/interact.mcfunction @@ -1,3 +1,4 @@ +#> enemy:reboot_spawner/interact #探索距離7ブロック scoreboard players set _ _ 70 #視線先のスポナーを探索 diff --git a/data/enemy/function/reboot_spawner/reboot.mcfunction b/data/enemy/function/reboot_spawner/reboot.mcfunction index 4a5f4f0812..cda1288e8b 100644 --- a/data/enemy/function/reboot_spawner/reboot.mcfunction +++ b/data/enemy/function/reboot_spawner/reboot.mcfunction @@ -1,3 +1,3 @@ - +#> enemy:reboot_spawner/reboot execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnData.entity.id set from entity @s item.tag.Spawner.SpawnData.entity.id execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnPotentials[0].data.entity.id set from entity @s item.tag.Spawner.SpawnPotentials[0].data.entity.id diff --git a/data/enemy/function/reboot_spawner/search.mcfunction b/data/enemy/function/reboot_spawner/search.mcfunction index 3178f30e54..9e856ca2d6 100644 --- a/data/enemy/function/reboot_spawner/search.mcfunction +++ b/data/enemy/function/reboot_spawner/search.mcfunction @@ -1,3 +1,4 @@ +#> enemy:reboot_spawner/search #視線先のスポナーを探索 scoreboard players remove _ _ 1 execute if score _ _ matches 1.. unless block ^ ^ ^ spawner positioned ^ ^ ^0.1 run function enemy:reboot_spawner/search From 67bf3068e4fc9cf485fddb3c6a6e7356281788af Mon Sep 17 00:00:00 2001 From: Ponpon Date: Sat, 4 Oct 2025 22:14:50 +0900 Subject: [PATCH 3/3] =?UTF-8?q?GH-913=20Modify=20=E3=82=A2=E3=82=A4?= =?UTF-8?q?=E3=83=86=E3=83=A0=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=E5=8C=96=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/enemy/function/reboot_spawner/reboot.mcfunction | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/enemy/function/reboot_spawner/reboot.mcfunction b/data/enemy/function/reboot_spawner/reboot.mcfunction index cda1288e8b..53ef2e40e0 100644 --- a/data/enemy/function/reboot_spawner/reboot.mcfunction +++ b/data/enemy/function/reboot_spawner/reboot.mcfunction @@ -1,3 +1,3 @@ #> enemy:reboot_spawner/reboot -execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnData.entity.id set from entity @s item.tag.Spawner.SpawnData.entity.id -execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnPotentials[0].data.entity.id set from entity @s item.tag.Spawner.SpawnPotentials[0].data.entity.id +execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnData.entity.id set from entity @s item.components."minecraft:custom_data".Spawner.SpawnData.entity.id +execute as @e[tag=Spawner,distance=..0.01,limit=1] at @s run data modify block ~ ~ ~ SpawnPotentials[0].data.entity.id set from entity @s item.components."minecraft:custom_data".Spawner.SpawnPotentials[0].data.entity.id