Skip to content
On this page
NeoForge

ServerLivingEntityEvent

top.katton.api.eventneoforge/src/main/kotlin/top/katton/api/event/ServerLivingEntityEvent.kt
Server-side living entity events for NeoForge platform.

ServerLivingEntityEvent

ServerLivingEntityEventNeoForgeObject
kotlin
@EventBusSubscriber( modid = top.katton.Katton.MOD_ID, value = [Dist.DEDICATED_SERVER] )
modid

Server-side living entity events for NeoForge platform.

This object provides events related to living entity lifecycle including damage, death, drops, falling, jumping, and mob conversion.

ServerLivingEntityEvent.onLivingHurt

ServerLivingEntityEvent.onLivingHurtNeoForgeProperty
kotlin
val onLivingHurt

Event triggered when a living entity is hurt. Can be cancelled to prevent the damage.

ServerLivingEntityEvent.onAllowDamage

ServerLivingEntityEvent.onAllowDamageNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowDamage

Event triggered to allow or deny damage to a living entity.

Returns

true to allow the damage, false to cancel it.

ServerLivingEntityEvent.onAfterDamage

ServerLivingEntityEvent.onAfterDamageNeoForgeProperty
kotlin
@JvmField
@JvmField val onAfterDamage

Event triggered after a living entity takes damage.

ServerLivingEntityEvent.onAllowDeath

ServerLivingEntityEvent.onAllowDeathNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowDeath

Event triggered to allow or deny death of a living entity.

Returns

true to allow the death, false to cancel it.

ServerLivingEntityEvent.onAfterDeath

ServerLivingEntityEvent.onAfterDeathNeoForgeProperty
kotlin
@JvmField
@JvmField val onAfterDeath

Event triggered after a living entity dies.

ServerLivingEntityEvent.onLivingDrops

ServerLivingEntityEvent.onLivingDropsNeoForgeProperty
kotlin
val onLivingDrops

Event triggered when a living entity drops items upon death. Can be cancelled to prevent drops.

ServerLivingEntityEvent.onLivingFall

ServerLivingEntityEvent.onLivingFallNeoForgeProperty
kotlin
val onLivingFall

Event triggered when a living entity falls. Can be cancelled to prevent fall damage processing.

ServerLivingEntityEvent.onLivingJump

ServerLivingEntityEvent.onLivingJumpNeoForgeProperty
kotlin
val onLivingJump

Event triggered when a living entity jumps.

ServerLivingEntityEvent.onMobConversion

ServerLivingEntityEvent.onMobConversionNeoForgeProperty
kotlin
val onMobConversion

Event triggered when a mob is converted to another type (e.g., zombie villager curing, piglin zombification).