Skip to content
On this page

Fabric

ChunkAndBlockEvent

top.katton.api.eventfabric/src/main/kotlin/top/katton/api/event/ChunkAndBlockEvent.kt
Chunk, block entity, and block events for Fabric platform.

ChunkAndBlockEvent

FabricObject
kotlin
@Suppress("unused")
object ChunkAndBlockEvent

Chunk, block entity, and block events for Fabric platform.

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

ChunkAndBlockEvent.onChunkLoad

FabricProperty
kotlin
val onChunkLoad

Event triggered when a chunk is loaded.

ChunkAndBlockEvent.onChunkUnload

FabricProperty
kotlin
val onChunkUnload

Event triggered when a chunk is unloaded.

ChunkAndBlockEvent.onChunkLevelTypeChange

FabricProperty
kotlin
val onChunkLevelTypeChange

Event triggered when a chunk's full status changes.

ChunkAndBlockEvent.onBlockEntityLoad

FabricProperty
kotlin
val onBlockEntityLoad

Event triggered when a block entity is loaded.

ChunkAndBlockEvent.onBlockEntityUnload

FabricProperty
kotlin
val onBlockEntityUnload

Event triggered when a block entity is unloaded.

ChunkAndBlockEvent.onBeforeBlockBreak

FabricProperty
kotlin
val onBeforeBlockBreak

Event triggered before a player breaks a block.

Returns

true to allow the break, false to cancel it.

ChunkAndBlockEvent.onAfterBlockBreak

FabricProperty
kotlin
val onAfterBlockBreak

Event triggered after a player breaks a block.

ChunkAndBlockEvent.onCanceledBlockBreak

FabricProperty
kotlin
val onCanceledBlockBreak

Event triggered when a block break is canceled.

ChunkAndBlockEvent.onExplosionStart

FabricProperty
kotlin
@JvmField
@JvmField val onExplosionStart

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

ChunkAndBlockEvent.onExplosionDetonate

FabricProperty
kotlin
@JvmField
@JvmField val onExplosionDetonate

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