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 ​

ServerMobEffectEventNeoForgeObject
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 ​

ServerMobEffectEvent.onMobEffectApplicableNeoForgeProperty
kotlin
val onMobEffectApplicable

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

ServerMobEffectEvent.onMobEffectAdd ​

ServerMobEffectEvent.onMobEffectAddNeoForgeProperty
kotlin
val onMobEffectAdd

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

ServerMobEffectEvent.onMobEffectRemove ​

ServerMobEffectEvent.onMobEffectRemoveNeoForgeProperty
kotlin
val onMobEffectRemove

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

ServerMobEffectEvent.onMobEffectExpire ​

ServerMobEffectEvent.onMobEffectExpireNeoForgeProperty
kotlin
val onMobEffectExpire

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

ServerMobEffectEvent.MobEffectApplicableArg ​

ServerMobEffectEvent.MobEffectApplicableArgNeoForgeData 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 ​

ServerMobEffectEvent.MobEffectAddArgNeoForgeData 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 ​

ServerMobEffectEvent.MobEffectRemoveArgNeoForgeData 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 ​

ServerMobEffectEvent.MobEffectExpireArgNeoForgeData 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)