-
Bug
-
Resolution: Fixed
-
1.19.4
-
None
-
Confirmed
-
Commands
-
Important
-
Platform
The bug
According to the changelog, the execute if loaded command "checks if the position given is fully loaded (in regard to both blocks and entities)". However in some cases entities have not finished loading.
How to reproduce
- Create a new flat world
- Place a repeating command block at world spawn with the following command. Set it to always active.
/execute if loaded 1000 0 0 unless entity @e[type=pig] run say Chunk is loaded but entity is not!
- Teleport to 1000 0 0 and summon a pig there
/teleport @s 1000 0 0 /summon pig 1000 0 0 {NoAI:1b}
- Leave and rejoin the world
- Teleport to the nether and a bit later teleport back
Notice that in both cases for one tick the chunk was loaded but the pig wasn't. In more complex worlds with more entities this can take an unpredictable amount of ticks.