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>

public static class ChunkEvent.Load extends ChunkEvent<net.minecraft.world.level.chunk.LevelChunk>
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.

  • 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