Skip to content
On this page
Fabric

LivingBehaviorEvent

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

LivingBehaviorEvent

LivingBehaviorEventFabricObject
kotlin
@Suppress("unused")
object LivingBehaviorEvent

Living entity behavior events for Fabric platform.

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

LivingBehaviorEvent.onElytraAllow

LivingBehaviorEvent.onElytraAllowFabricProperty
kotlin
val onElytraAllow

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

Returns

true to allow elytra usage, false to deny.

LivingBehaviorEvent.onElytraCustom

LivingBehaviorEvent.onElytraCustomFabricProperty
kotlin
val onElytraCustom

Event triggered to provide custom elytra flight behavior.

Returns

true if custom behavior is applied, false to use default.

LivingBehaviorEvent.onAllowSleeping

LivingBehaviorEvent.onAllowSleepingFabricProperty
kotlin
val onAllowSleeping

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

Returns

BedSleepingProblem if sleep is denied, null to allow.

LivingBehaviorEvent.onStartSleeping

LivingBehaviorEvent.onStartSleepingFabricProperty
kotlin
val onStartSleeping

Event triggered when a player starts sleeping.

LivingBehaviorEvent.onStopSleeping

LivingBehaviorEvent.onStopSleepingFabricProperty
kotlin
val onStopSleeping

Event triggered when a player stops sleeping.

LivingBehaviorEvent.onAllowBed

LivingBehaviorEvent.onAllowBedFabricProperty
kotlin
val onAllowBed

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

Returns

EventResult indicating the result of the check.

LivingBehaviorEvent.onAllowNearbyMonsters

LivingBehaviorEvent.onAllowNearbyMonstersFabricProperty
kotlin
val onAllowNearbyMonsters

Event triggered to check if nearby monsters prevent sleeping.

Returns

EventResult indicating whether monsters should prevent sleep.

LivingBehaviorEvent.onAllowResettingTime

LivingBehaviorEvent.onAllowResettingTimeFabricProperty
kotlin
val onAllowResettingTime

Event triggered to check if time should reset after sleeping.

Returns

true to allow time reset, false to prevent it.

LivingBehaviorEvent.onModifySleepingDirection

LivingBehaviorEvent.onModifySleepingDirectionFabricProperty
kotlin
val onModifySleepingDirection

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

Returns

The modified direction for the player to face.

LivingBehaviorEvent.onAllowSettingSpawn

LivingBehaviorEvent.onAllowSettingSpawnFabricProperty
kotlin
val onAllowSettingSpawn

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

Returns

true to allow setting spawn, false to prevent it.

LivingBehaviorEvent.onSetBedOccupationState

LivingBehaviorEvent.onSetBedOccupationStateFabricProperty
kotlin
val onSetBedOccupationState

Event triggered to set the bed occupation state.

Returns

true if the state was handled, false for default behavior.

LivingBehaviorEvent.onModifyWakeUpPosition

LivingBehaviorEvent.onModifyWakeUpPositionFabricProperty
kotlin
val onModifyWakeUpPosition

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

Returns

The modified Vec3 wake-up position.

LivingBehaviorEvent.onPlayerWakeUp

LivingBehaviorEvent.onPlayerWakeUpFabricProperty
kotlin
@JvmField
@JvmField val onPlayerWakeUp

Event triggered when a player wakes up from sleeping.