Class ChunkEvent.Load
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.LevelEvent
net.neoforged.neoforge.event.level.ChunkEvent<net.minecraft.world.level.chunk.LevelChunk>
net.neoforged.neoforge.event.level.ChunkEvent.Load
- Enclosing class:
ChunkEvent<T extends net.minecraft.world.level.chunk.ChunkAccess>
This event is fired after Minecraft loads a
LevelChunk
into the level, on both the client and server.
Specifically, this is fired during chunk loading in ChunkStatusTasks.full(net.minecraft.world.level.chunk.status.WorldGenContext, net.minecraft.world.level.chunk.status.ChunkStep, net.minecraft.util.StaticCache2D<net.minecraft.server.level.GenerationChunkHolder>, net.minecraft.world.level.chunk.ChunkAccess)
, and when the client receives a chunk from the server.
Note: On the server, this event is fired before the underlying LevelChunk
is promoted to ChunkStatus.FULL
.
Interactions with the level
must be delayed until the next game tick to prevent deadlocking the game.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.ChunkEvent
ChunkEvent.Load, ChunkEvent.Unload
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.LevelEvent
LevelEvent.CreateSpawnPosition, LevelEvent.PotentialSpawns, LevelEvent.Save
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this is a newly-generated chunk, instead of one loaded from disk.Methods inherited from class net.neoforged.neoforge.event.level.ChunkEvent
getChunk
Methods inherited from class net.neoforged.neoforge.event.level.LevelEvent
getLevel
-
Field Details
-
newChunk
private final boolean newChunk
-
-
Constructor Details
-
Load
@Internal public Load(net.minecraft.world.level.chunk.LevelChunk chunk, boolean newChunk)
-
-
Method Details
-
isNewChunk
public boolean isNewChunk()Returns true if this is a newly-generated chunk, instead of one loaded from disk.- Returns:
- true if this is a newly-generated chunk, instead of one loaded from disk
-