Skip to content
On this page

NeoForge

ServerMobEffectEvent

top.katton.api.eventneoforge/src/main/kotlin/top/katton/api/event/ServerMobEffectEvent.kt
Mob effect events for NeoForge platform.

ServerMobEffectEvent

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

Mob effect events for NeoForge platform.

This object provides events related to mob effects (potions) including adding, removing, expiring, and checking applicability of effects.

ServerMobEffectEvent.onMobEffectApplicable

NeoForgeProperty
kotlin
val onMobEffectApplicable

Event triggered to check if a mob effect is applicable to an entity.

ServerMobEffectEvent.onMobEffectAdd

NeoForgeProperty
kotlin
val onMobEffectAdd

Event triggered when a mob effect is added to an entity.

ServerMobEffectEvent.onMobEffectRemove

NeoForgeProperty
kotlin
val onMobEffectRemove

Event triggered when a mob effect is removed from an entity. Can be cancelled to prevent removal.

ServerMobEffectEvent.onMobEffectExpire

NeoForgeProperty
kotlin
val onMobEffectExpire

Event triggered when a mob effect expires on an entity. Can be cancelled to prevent expiration.

ServerMobEffectEvent.MobEffectApplicableArg

NeoForgeData Class
kotlin
data class MobEffectApplicableArg( val entity: LivingEntity, val effect: MobEffectInstance )

Argument class for mob effect applicable events.

Properties

PropertyDescription
entityThe living entity being checked
effectThe effect instance being checked

ServerMobEffectEvent.MobEffectAddArg

NeoForgeData Class
kotlin
data class MobEffectAddArg( val entity: LivingEntity, val effect: MobEffectInstance, val source: Entity? )

Argument class for mob effect add events.

Properties

PropertyDescription
entityThe living entity receiving the effect
effectThe effect instance being added
sourceThe entity that caused the effect (can be null)

ServerMobEffectEvent.MobEffectRemoveArg

NeoForgeData Class
kotlin
data class MobEffectRemoveArg( val entity: LivingEntity, val effect: MobEffectInstance? ): CancellableEventArg()

Argument class for mob effect remove events.

Properties

PropertyDescription
entityThe living entity losing the effect
effectThe effect instance being removed (can be null if removed by type)

ServerMobEffectEvent.MobEffectExpireArg

NeoForgeData Class
kotlin
data class MobEffectExpireArg( val entity: LivingEntity, val effect: MobEffectInstance? ): CancellableEventArg()

Argument class for mob effect expire events.

Properties

PropertyDescription
entityThe living entity whose effect expired
effectThe effect instance that expired (can be null)