commands: selectors find the End crystals and the Ender Dragon
Horizon's command targets enumerated the ordinary entity collections only, so `@e[type=end_crystal]` and `@e[type=ender_dragon]` matched nothing: the End crystals and the dragon live in their own lists, and neither carried an entity id a command could name. The crystals and the dragon now take an id from the entity counter when they are created, as EndCrystal's and EnderDragon's constructors do; the selector offers them as candidates; `/data get entity` reads them and `/kill` removes them the way `Entity.kill` does. `/summon minecraft:end_crystal` creates one, as vanilla does. Fixes #1531 Co-Authored-By: minimax-m3.1-flash (Claude Code) <noreply@users.noreply.github.com>
This commit is contained in:
@@ -327,6 +327,17 @@ def entities():
|
||||
cmd('/data get entity @e[tag=attr,limit=1] Health'),
|
||||
cmd('/attribute @e[tag=attr,limit=1] minecraft:attack_damage base get'),
|
||||
cmd('/kill @e[tag=attr]'),
|
||||
# An End crystal is an entity of its own: a type selector finds it,
|
||||
# reads it and kills it (#1531).
|
||||
cmd('/summon minecraft:end_crystal 4.5 210 8.5'),
|
||||
cmd('/execute if entity @e[type=minecraft:end_crystal]'),
|
||||
cmd('/data get entity @e[type=minecraft:end_crystal,limit=1] Pos'),
|
||||
cmd('/kill @e[type=minecraft:end_crystal]'),
|
||||
cmd('/execute if entity @e[type=minecraft:end_crystal]'),
|
||||
cmd('/summon minecraft:ender_dragon 4.5 210 8.5'),
|
||||
cmd('/execute if entity @e[type=minecraft:ender_dragon]'),
|
||||
cmd('/data get entity @e[type=minecraft:ender_dragon,limit=1] Pos'),
|
||||
cmd('/kill @e[type=minecraft:ender_dragon]'),
|
||||
*setup('/kill @e[type=minecraft:armor_stand]'),
|
||||
{'op': 'tick', 'n': 25},
|
||||
cmd('/execute if entity @e[tag=h]'),
|
||||
|
||||
Reference in New Issue
Block a user