mojira.dev
MC-125068

Execute if/unless entity lags behind /kill in same function

If you run the /kill command in a function, the entities you've killed are not removed from the world until the next tick. This means you get unexpected behavior with code like the following:

kill @e[type=armor_stand,tag=Marker]
execute if entity @e[type=armor_stand,tag=Marker] run say Found!

You'd expect it to not say anything because all the Marker stands are dead, but it will still output because the stands aren't removed from the world until the next tick.

Comments

migrated

@unknown @s is supposed to target the dead, @e isn’t. that’s how it worked in 1.12, at least.

migrated

It seems to be fixed in 18w07c. I made a function with the commands you provided, and no text is output in chat, only a confirmation that the two commands in the function were executed. Tested this by summoning an armor stand with Tags:["Marker"] and another with Tags:[Marker] in case that caused issues, which it did not.

migrated

@@unknown is this fixed for you?

migrated

A quick test shows that it works fine in 18w07c, at least with a chain of command blocks. I can't test how it performs with functions until tomorrow, though I can't see why one would work without the other also working (since command chains occur in 1 tick as well).

wobst.michael

Marking as fixed now. Let us know if the ticket needs to be reopened.

migrated

(Unassigned)

Unconfirmed

Minecraft 18w06a

Minecraft 18w07c

Retrieved