Skip to main content
Version: Minecraft 26.2

dev.polymodloader.api.event.world

Generated

This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.

TypeKindDescription
ChunkListenerfunctional interfaceListener for WorldEvents.CHUNK_LOADED and WorldEvents.CHUNK_UNLOADED.
WorldEventsclassServer-side dimension events.
WorldListenerfunctional interfaceListener for WorldEvents.LOADED, WorldEvents.UNLOADED, and WorldEvents.SAVING.
WorldReadyListenerfunctional interfaceListener for WorldEvents.READY.

ChunkListener​

functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public interface ChunkListener

Listener for WorldEvents.CHUNK_LOADED and WorldEvents.CHUNK_UNLOADED.

onChunk(WorldView, int, int)​

void onChunk(WorldView world, int chunkX, int chunkZ)

Since 0.1.0-alpha.4 or earlier

A chunk of world; coordinates are chunk coordinates. Keep it cheap: chunks load often.

ParameterTypeDescription
worldWorldView—
chunkXint—
chunkZint—

WorldEvents​

class · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public final class WorldEvents

Server-side dimension events. Per dimension and server start the order is LOADED, READY, SAVING (on every save), UNLOADED. Fabric API: ServerWorldEvents; NeoForge: LevelEvent.Load, Unload, Save.

Constant or fieldTypeDescription
LOADEDEventKey<WorldListener>The server created every dimension of the world; fired for each, before spawn chunks are prepared and before the first tick. Dimensions are not saved or ticking yet.
SAVINGEventKey<WorldListener>A dimension is about to be saved (autosave, /save-all, or stopping), before its chunks and level data are written; changes made now are saved with it.
UNLOADEDEventKey<WorldListener>The stopping server is about to close a dimension, after it was saved; the last moment to read it. Changes are not saved any more.
READYEventKey<WorldReadyListener>A dimension ticks for the first time after it was loaded or created; a good moment to read WorldView.storage. Fired once per dimension per server start.
CHUNK_LOADEDEventKey<ChunkListener>A chunk finished loading (from disk or newly generated) on the server.
CHUNK_UNLOADEDEventKey<ChunkListener>A chunk is about to be unloaded on the server; it has been saved.

WorldListener​

functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public interface WorldListener

Listener for WorldEvents.LOADED, WorldEvents.UNLOADED, and WorldEvents.SAVING.

onWorld(WorldView)​

void onWorld(WorldView world)

Since 0.1.0-alpha.4 or earlier

Called on the server thread; world is valid only during the call.

ParameterTypeDescription
worldWorldView—

WorldReadyListener​

functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public interface WorldReadyListener

Listener for WorldEvents.READY.

onWorldReady(WorldView)​

void onWorldReady(WorldView world)

Since 0.1.0-alpha.4 or earlier

Called on the server thread at the start of the dimension's first tick.

ParameterTypeDescription
worldWorldView—
Buy me a coffee