Skip to content
On this page
NeoForge

ChunkAndBlockEvent

top.katton.api.eventneoforge/src/main/kotlin/top/katton/api/event/ChunkAndBlockEvent.kt
Chunk, block, and explosion events for NeoForge platform.

ChunkAndBlockEvent ​

ChunkAndBlockEventNeoForgeObject
kotlin
@Suppress("unused")
@EventBusSubscriber( modid = Katton.MOD_ID, value = [Dist.DEDICATED_SERVER] )
modid

Chunk, block, and explosion events for NeoForge platform.

This object provides events related to chunk loading/unloading, block breaking/placing, and explosions.

ChunkAndBlockEvent.onChunkLoad ​

ChunkAndBlockEvent.onChunkLoadNeoForgeProperty
kotlin
val onChunkLoad

Event triggered when a chunk is loaded.

ChunkAndBlockEvent.onChunkUnload ​

ChunkAndBlockEvent.onChunkUnloadNeoForgeProperty
kotlin
val onChunkUnload

Event triggered when a chunk is unloaded.

ChunkAndBlockEvent.onChunkDataLoad ​

ChunkAndBlockEvent.onChunkDataLoadNeoForgeProperty
kotlin
val onChunkDataLoad

Event triggered when chunk data is loaded from disk.

ChunkAndBlockEvent.onChunkDataSave ​

ChunkAndBlockEvent.onChunkDataSaveNeoForgeProperty
kotlin
val onChunkDataSave

Event triggered when chunk data is saved to disk.

ChunkAndBlockEvent.onChunkWatch ​

ChunkAndBlockEvent.onChunkWatchNeoForgeProperty
kotlin
val onChunkWatch

Event triggered when a player starts watching a chunk.

ChunkAndBlockEvent.onChunkSent ​

ChunkAndBlockEvent.onChunkSentNeoForgeProperty
kotlin
val onChunkSent

Event triggered when a chunk is sent to a player.

ChunkAndBlockEvent.onChunkUnWatch ​

ChunkAndBlockEvent.onChunkUnWatchNeoForgeProperty
kotlin
val onChunkUnWatch

Event triggered when a player stops watching a chunk.

ChunkAndBlockEvent.onChunkLevelTypeChange ​

ChunkAndBlockEvent.onChunkLevelTypeChangeNeoForgeProperty
kotlin
@JvmField
@JvmField val onChunkLevelTypeChange

Event triggered when a chunk's level type changes. Note: This is a placeholder for NeoForge compatibility.

ChunkAndBlockEvent.onBlockEntityLoad ​

ChunkAndBlockEvent.onBlockEntityLoadNeoForgeProperty
kotlin
@JvmField
@JvmField val onBlockEntityLoad

Event triggered when a block entity is loaded. Note: This is a placeholder for NeoForge compatibility.

ChunkAndBlockEvent.onBlockEntityUnload ​

ChunkAndBlockEvent.onBlockEntityUnloadNeoForgeProperty
kotlin
@JvmField
@JvmField val onBlockEntityUnload

Event triggered when a block entity is unloaded. Note: This is a placeholder for NeoForge compatibility.

ChunkAndBlockEvent.onBlockBreak ​

ChunkAndBlockEvent.onBlockBreakNeoForgeProperty
kotlin
val onBlockBreak

Event triggered when a player breaks a block. Can be cancelled to prevent the break.

ChunkAndBlockEvent.onBlockPlace ​

ChunkAndBlockEvent.onBlockPlaceNeoForgeProperty
kotlin
val onBlockPlace

Event triggered when a player places a block. Can be cancelled to prevent the placement.

ChunkAndBlockEvent.onExplosionStart ​

ChunkAndBlockEvent.onExplosionStartNeoForgeProperty
kotlin
val onExplosionStart

Event triggered when an explosion starts. Can be cancelled to prevent the explosion.

ChunkAndBlockEvent.onExplosionDetonate ​

ChunkAndBlockEvent.onExplosionDetonateNeoForgeProperty
kotlin
val onExplosionDetonate

Event triggered when an explosion detonates. Use this to modify affected blocks/entities.

ChunkAndBlockEvent.NeoChunkDataLoadArg ​

ChunkAndBlockEvent.NeoChunkDataLoadArgNeoForgeData Class
kotlin
data class NeoChunkDataLoadArg( val level: ServerLevel, val chunk: ChunkAccess, val data: SerializableChunkData, val type: ChunkType )

Argument class for NeoForge chunk data load events.

Properties ​

PropertyDescription
levelThe server level
chunkThe chunk being loaded
dataThe serializable chunk data
typeThe chunk type

ChunkAndBlockEvent.NeoChunkDataSaveArg ​

ChunkAndBlockEvent.NeoChunkDataSaveArgNeoForgeData Class
kotlin
data class NeoChunkDataSaveArg( val level: ServerLevel, val chunk: ChunkAccess, val data: SerializableChunkData )

Argument class for NeoForge chunk data save events.

Properties ​

PropertyDescription
levelThe server level
chunkThe chunk being saved
dataThe serializable chunk data

ChunkAndBlockEvent.NeoChunkWatchArg ​

ChunkAndBlockEvent.NeoChunkWatchArgNeoForgeData Class
kotlin
data class NeoChunkWatchArg( val player: ServerPlayer, val level: ServerLevel, val chunk: LevelChunk )

Argument class for NeoForge chunk watch events.

Properties ​

PropertyDescription
playerThe player watching the chunk
levelThe server level
chunkThe level chunk being watched

ChunkAndBlockEvent.NeoChunkUnWatchArg ​

ChunkAndBlockEvent.NeoChunkUnWatchArgNeoForgeData Class
kotlin
data class NeoChunkUnWatchArg( val player: ServerPlayer, val level: ServerLevel, val pos: ChunkPos )

Argument class for NeoForge chunk unwatch events.

Properties ​

PropertyDescription
playerThe player stopping watching the chunk
levelThe server level
posThe chunk position