0

/execute as @e[type=minecraft:item] at @s run kill @e[type=minecraft:item,y=5,dy=0]

/execute as @e[type=minecraft:area_effect_cloud] at @s run kill @e[type=minecraft:area_effect_cloud,y=5,dy=0]

After running these 2 commands with the setup above, only the apple is killed. What am I doing wrong?

(vanilla, 1.15.2)

2
  • 1
    What else would you expect to happen? And what is that hitbox on the right? BTW, you can embed images directly: ![](link) Also, you should use double @e sparingly, it does as many checks as the number of entities squared. I'm not sure what you're trying to do, but it looks like it's probably not required. Commented Mar 15, 2020 at 0:36
  • 1
    The hitbox on the right is the area_effect_cloud. I am trying to detect if it is at a certain y value, but it does not work. It works just fine for the apple, however. The 2 commands are exactly the same, just different types of entities. So, this leads me to believe that this is a bug of some sort.
    – ginkgo
    Commented Mar 15, 2020 at 0:59

1 Answer 1

1

This is a known bug: https://bugs.mojang.com/browse/MC-88533

You could try dy=1 or even dy=2 and add sort=nearest,limit=1 as a workaround.

Apart from that, you should use @s as the second selector, if you just want to select the one entity itself, otherwise you run something for all entities as all entities, which quickly gets pretty laggy. If you do that, you don't need sort=nearest,limit=1 anymore.

Not the answer you're looking for? Browse other questions tagged or ask your own question.