mojira.dev
MC-198339

Entities won't unload with chunk when being detected by "execute if/unless block"

Entities won't unload with chunk if they are being detected by "execute if/unless block" and they can still be found using "execute if entity".

How to reproduce it:
1.Keep the following command running per game tick(e.g. write it in an function and add that function to tick.json): execute as @e[tag=sth] at @s unless block ~ ~ ~ stone
2.Go to a place where isn't loaded by /forceload or in a spawn chunk.(e.g. 29999974,10,29999974)
3.Summon an entity with tag "sth" there(the tag is just for convenience of selecting it)
4.Leave that position and make sure the chunk there is unloaded
5.Detect the entity with "execute if entity @e[tag=sth]"
6.You'll find that the entity you just summoned is still loaded despite the fact that the chunk where it is was unloaded.

The entity won't be unloaded until you stop the command in step 1 from running or quit the  world.

Linked issues

Comments 4

Please provide some screenshots or videos of this issue occurring whilst the F3 debug screen is enabled.

The chunk is loaded due to the unless block ~ ~ ~ stone check being executed every tick. If you remove that part from the tick function both the chunk and entity will be unloaded.

For what it's worth, this should be marked as a duplicate of MC-168596 instead of Invalid.

Thanks, linked as a duplicate to MC-168596.

Huge_Black

(Unassigned)

Unconfirmed

(Unassigned)

1.16.2

Retrieved