Skip to content
On this page
NeoForge

LivingBehaviorEvent

top.katton.api.eventneoforge/src/main/kotlin/top/katton/api/event/LivingBehaviorEvent.kt
Living entity behavior events for NeoForge platform.

LivingBehaviorEvent ​

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

Living entity behavior events for NeoForge platform.

This object provides events related to living entity behaviors including animal taming, baby spawning, elytra flight, and sleeping.

LivingBehaviorEvent.onAnimalTame ​

LivingBehaviorEvent.onAnimalTameNeoForgeProperty
kotlin
val onAnimalTame

Event triggered when an animal is being tamed. Can be cancelled to prevent taming.

LivingBehaviorEvent.onBabySpawn ​

LivingBehaviorEvent.onBabySpawnNeoForgeProperty
kotlin
val onBabySpawn

Event triggered when a baby entity is spawning (breeding). Can be cancelled to prevent the spawn.

LivingBehaviorEvent.onElytraAllow ​

LivingBehaviorEvent.onElytraAllowNeoForgeProperty
kotlin
@JvmField
@JvmField val onElytraAllow

Event triggered to check if an entity is allowed to use elytra.

Returns ​

to allow elytra usage, false to deny.

LivingBehaviorEvent.onElytraCustom ​

LivingBehaviorEvent.onElytraCustomNeoForgeProperty
kotlin
@JvmField
@JvmField val onElytraCustom

Event triggered to provide custom elytra flight behavior.

Returns ​

if custom behavior is applied, false to use default.

LivingBehaviorEvent.onAllowSleeping ​

LivingBehaviorEvent.onAllowSleepingNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowSleeping

Event triggered to check if a player is allowed to sleep.

Returns ​

if sleep is denied, null to allow.

LivingBehaviorEvent.onStartSleeping ​

LivingBehaviorEvent.onStartSleepingNeoForgeProperty
kotlin
@JvmField
@JvmField val onStartSleeping

Event triggered when a player starts sleeping.

LivingBehaviorEvent.onStopSleeping ​

LivingBehaviorEvent.onStopSleepingNeoForgeProperty
kotlin
@JvmField
@JvmField val onStopSleeping

Event triggered when a player stops sleeping.

LivingBehaviorEvent.onAllowBed ​

LivingBehaviorEvent.onAllowBedNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowBed

Event triggered to check if a player is allowed to use a bed.

Returns ​

indicating the result of the check.

LivingBehaviorEvent.onAllowNearbyMonsters ​

LivingBehaviorEvent.onAllowNearbyMonstersNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowNearbyMonsters

Event triggered to check if nearby monsters prevent sleeping.

Returns ​

indicating whether monsters should prevent sleep.

LivingBehaviorEvent.onAllowResettingTime ​

LivingBehaviorEvent.onAllowResettingTimeNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowResettingTime

Event triggered to check if time should reset after sleeping.

Returns ​

to allow time reset, false to prevent it.

LivingBehaviorEvent.onModifySleepingDirection ​

LivingBehaviorEvent.onModifySleepingDirectionNeoForgeProperty
kotlin
@JvmField
@JvmField val onModifySleepingDirection

Event triggered to modify the sleeping direction when entering a bed.

Returns ​

modified direction for the player to face.

LivingBehaviorEvent.onAllowSettingSpawn ​

LivingBehaviorEvent.onAllowSettingSpawnNeoForgeProperty
kotlin
@JvmField
@JvmField val onAllowSettingSpawn

Event triggered to check if spawn point should be set when sleeping.

Returns ​

to allow setting spawn, false to prevent it.

LivingBehaviorEvent.onSetBedOccupationState ​

LivingBehaviorEvent.onSetBedOccupationStateNeoForgeProperty
kotlin
@JvmField
@JvmField val onSetBedOccupationState

Event triggered to set the bed occupation state.

Returns ​

if the state was handled, false for default behavior.

LivingBehaviorEvent.onModifyWakeUpPosition ​

LivingBehaviorEvent.onModifyWakeUpPositionNeoForgeProperty
kotlin
@JvmField
@JvmField val onModifyWakeUpPosition

Event triggered to modify the player's wake-up position.

Returns ​

modified Vec3 wake-up position.

LivingBehaviorEvent.onPlayerWakeUp ​

LivingBehaviorEvent.onPlayerWakeUpNeoForgeProperty
kotlin
val onPlayerWakeUp

Event triggered when a player wakes up from sleeping.