Mojira Archive
MC-124871

killing an entity in a function and testing for that entity afterward will still execute commands

This causes a major issue with recursive functions that rely on killing an entity to terminate the chain. It seems that the armor stand is killed 1 tick later, causing conditional commands that check for that entity to still execute until the function ends. This contrasts from the teleport command, in which the player can use the execute command to update the position at which teleport commands will be relative to. These are the commands, used in a function:

/kill @s
/execute if @s run say hi

What I expected: the executing entity is killed and the second command never runs.
What actually happened: in chat: [executing entity]:hi, then the entity gets killed.

I got tired of constantly searching the bug tracker for this issue and turning up mainly results that in no way relate to it, even with using more specific search criteria. I might have seen one that has to do with if statements not working correctly, but I haven't been able to find it again.

Works As Intended

Aaron Rhodes

2018-02-09, 12:09 AM

2024-03-02, 12:10 AM

2018-02-14, 12:13 AM

0

1

Unconfirmed

Minecraft 18w05a

-