Class ServerChunkEvents
java.lang.Object
net.fabricmc.fabric.api.event.lifecycle.v1.ServerChunkEvents
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Event
<ServerChunkEvents.Generate> Called when a newly generated chunk is loaded into a ServerWorld.static final Event
<ServerChunkEvents.LevelTypeChange> Called when a chunk's actual ticking behavior is about to align with its updatedChunkLevelType
.static final Event
<ServerChunkEvents.Load> Called when a chunk is loaded into a ServerWorld.static final Event
<ServerChunkEvents.Unload> Called when a chunk is unloaded from a ServerWorld. -
Method Summary
-
Field Details
-
CHUNK_LOAD
Called when a chunk is loaded into a ServerWorld.When this event is called, the chunk is already in the world.
Note that this event is not called for chunks that become accessible without previously being unloaded.
- See Also:
-
CHUNK_GENERATE
Called when a newly generated chunk is loaded into a ServerWorld.When this event is called, the chunk is already in the world.
-
CHUNK_UNLOAD
Called when a chunk is unloaded from a ServerWorld.When this event is called, the chunk is still present in the world.
Note that the server typically unloads chunks when the chunk's level goes above 45 (and not immediately when the chunk becomes inaccessible). To know when a chunk first becomes inaccessible, see
CHUNK_LEVEL_TYPE_CHANGE
. -
CHUNK_LEVEL_TYPE_CHANGE
Called when a chunk's actual ticking behavior is about to align with its updatedChunkLevelType
.When this event is being called:
- The chunk's
WorldChunk.getLevelType()
has already changed. - Entities within the chunk are not guaranteed to be accessible.
- The chunk's corresponding level type future in
ChunkHolder
is not guaranteed to be done. - When transitioning from
ChunkLevelType.INACCESSIBLE
toChunkLevelType.FULL
, callingServerChunkManager.getChunkFutureSyncOnMainThread(int, int, ChunkStatus, boolean)
to fetch the current chunk atChunkStatus.FULL
status results in undefined behavior.
- The chunk's
-