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

NeoForgeObject
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

NeoForgeProperty
kotlin
val onChunkLoad

Event triggered when a chunk is loaded.

ChunkAndBlockEvent.onChunkUnload

NeoForgeProperty
kotlin
val onChunkUnload

Event triggered when a chunk is unloaded.

ChunkAndBlockEvent.onChunkDataLoad

NeoForgeProperty
kotlin
val onChunkDataLoad

Event triggered when chunk data is loaded from disk.

ChunkAndBlockEvent.onChunkDataSave

NeoForgeProperty
kotlin
val onChunkDataSave

Event triggered when chunk data is saved to disk.

ChunkAndBlockEvent.onChunkWatch

NeoForgeProperty
kotlin
val onChunkWatch

Event triggered when a player starts watching a chunk.

ChunkAndBlockEvent.onChunkSent

NeoForgeProperty
kotlin
val onChunkSent

Event triggered when a chunk is sent to a player.

ChunkAndBlockEvent.onChunkUnWatch

NeoForgeProperty
kotlin
val onChunkUnWatch

Event triggered when a player stops watching a chunk.

ChunkAndBlockEvent.onChunkLevelTypeChange

NeoForgeProperty
kotlin
@JvmField
@JvmField val onChunkLevelTypeChange

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

ChunkAndBlockEvent.onBlockEntityLoad

NeoForgeProperty
kotlin
@JvmField
@JvmField val onBlockEntityLoad

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

ChunkAndBlockEvent.onBlockEntityUnload

NeoForgeProperty
kotlin
@JvmField
@JvmField val onBlockEntityUnload

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

ChunkAndBlockEvent.onBlockBreak

NeoForgeProperty
kotlin
val onBlockBreak

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

ChunkAndBlockEvent.onBlockPlace

NeoForgeProperty
kotlin
val onBlockPlace

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

ChunkAndBlockEvent.onExplosionStart

NeoForgeProperty
kotlin
val onExplosionStart

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

ChunkAndBlockEvent.onExplosionDetonate

NeoForgeProperty
kotlin
val onExplosionDetonate

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

ChunkAndBlockEvent.NeoChunkDataLoadArg

NeoForgeData 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

NeoForgeData 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

NeoForgeData 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

NeoForgeData 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