
EntityChunkData
This modification creates a dynamic data structure that tracks all entities during their loading process. Instead of using the standard Level#getEntitiesOfClass
method for collecting entity information, the mod maintains a special map in the format of <Dimension ID, Map<Chunk Position, Set of Entity UUIDs>>
.
API
The core data element is EntitiesInChunkData#ENTITIES
:
public static final Map<ResourceLocation, Map<ChunkPos, Set<UUID>>> ENTITIES = new ConcurrentHashMap<>();
Important Information
Entity removal and addition operations are executed only after the server tick completes.