Mojira Archive
MC-260322

Execute on origin does not work for non-living entities

If you summon an area effect cloud, and set its Owner tag to a non-LivingEntity's UUID, then run this command:

/execute as @e[type=minecraft:area_effect_cloud] on origin run say hi

The entity with the UUID will not say anything, and nor will the AEC.

However, if you copy a player's UUID into the Owner of the AEC, it works fine and produces the result:

[Player] hi

If you then set the AEC's Owner back to the non-LivingEntity, it continues to act as if the player was the origin, and produce the same result:

[Player] hi

Exact commands to reproduce:

summon minecraft:area_effect_cloud ~ ~ ~ {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags:["hi"]}
summon block_display ~ ~ ~ {Tags:["hi"]}

data modify entity @e[type=area_effect_cloud, tag=hi, limit=1] Owner set from entity @e[type=block_display, tag=hi, limit=1] UUID

execute as @e[type=area_effect_cloud, tag=hi] on origin run say hi
### Expected output: [Block Display] hi
### Actual output: nothing

data modify entity @e[type=area_effect_cloud, tag=hi, limit=1] Owner set from entity @s UUID

execute as @e[type=area_effect_cloud, tag=hi] on origin run say hi
### Expected output: [Player] hi
### Actual output: [Player] hi

data modify entity @e[type=area_effect_cloud, tag=hi, limit-1] Owner set from entity @e[type=block_display, tag=hi, limit=1] UUID

execute as @e[type=area_effect_cloud, tag=hi] on origin run say hi
### Expected output: [Block Display] hi
### Actual output: [Player] hi

This behaviour resets when you reload the world.

Unresolved

TorNato

2023-02-18, 05:46 AM

2024-12-29, 06:00 PM

26

10

Confirmed

Low

Platform

Commands

23w07a, 23w43b, 24w13a, 1.21.4

-