Teleported entities refer to old chunk
Relates to:
It seems like when an entity gets teleported it still refers to the chunk it was before. (This fixes itself when the chunk it referred to gets unloaded or when you reopen the world).
How to reproduce:
- Go away from the spawn chunks
- Use this command /summon ArmorStand ~ ~ ~ {CustomName:playerChunk}
- Teleport the ArmorStand in an unloaded chunk, for example: /tp @e[type=ArmorStand,name=playerChunk] ~3000 ~ ~
- Wait some time and use /say @e[type=ArmorStand,name=playerChunk] It should say the name of the ArmorStand
- Try to execute on the entity
It will fails which means the chunk is not loaded, however commands still find the entity which means it is still loaded
Checking if the entity is in a different chunk after the teleportation, removing it from the old chunk and adding it to the new chunk seems to work.