Class ServerChunkEvents
java.lang.Object
net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Event<ServerChunkEvents.Generate> Deprecated.static final Event<ServerChunkEvents.Load> Called when a chunk is loaded into a ServerLevel.static final Event<ServerChunkEvents.Unload> Called when a chunk is unloaded from a ServerLevel.static final Event<ServerChunkEvents.FullChunkStatusChange> Called when a chunk's actual ticking behavior is about to align with its updatedFullChunkStatus. -
Method Summary
-
Field Details
-
CHUNK_LOAD
Called when a chunk is loaded into a ServerLevel.When this event is called, the chunk is already in the level.
Note that this event is not called for chunks that become accessible without previously being unloaded.
- See Also:
-
CHUNK_GENERATE
Deprecated.useCHUNK_LOADdirectly insteadCalled when a newly generated chunk is loaded into a ServerLevel.When this event is called, the chunk is already in the level.
-
CHUNK_UNLOAD
Called when a chunk is unloaded from a ServerLevel.When this event is called, the chunk is still present in the level.
Note that the server typically unloads chunks when the chunk's load level goes above
ChunkLevel.MAX_LEVEL(and not immediately when the chunk becomes inaccessible). To know when a chunk first becomes inaccessible, seeFULL_CHUNK_STATUS_CHANGE. -
FULL_CHUNK_STATUS_CHANGE
Called when a chunk's actual ticking behavior is about to align with its updatedFullChunkStatus.When this event is being called:
- The chunk's
LevelChunk.getFullStatus()has already changed. - Entities within the chunk are not guaranteed to be accessible.
- The chunk's corresponding full chunk status future in
ChunkHolderis not guaranteed to be done. - When transitioning from
FullChunkStatus.INACCESSIBLEtoFullChunkStatus.FULL, callingServerChunkCache.getChunkFuture(int, int, ChunkStatus, boolean)to fetch the current chunk atChunkStatus.FULLstatus results in undefined behavior.
- The chunk's
-
CHUNK_LOADdirectly instead