kotlin
@EventBusSubscriber( modid = Katton.MOD_ID, value = [Dist.DEDICATED_SERVER] )
modidMob 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
kotlin
val onMobEffectApplicableEvent triggered to check if a mob effect is applicable to an entity.
ServerMobEffectEvent.onMobEffectAdd
kotlin
val onMobEffectAddEvent triggered when a mob effect is added to an entity.
ServerMobEffectEvent.onMobEffectRemove
kotlin
val onMobEffectRemoveEvent triggered when a mob effect is removed from an entity. Can be cancelled to prevent removal.
ServerMobEffectEvent.onMobEffectExpire
kotlin
val onMobEffectExpireEvent triggered when a mob effect expires on an entity. Can be cancelled to prevent expiration.
ServerMobEffectEvent.MobEffectApplicableArg
kotlin
data class MobEffectApplicableArg( val entity: LivingEntity, val effect: MobEffectInstance )Argument class for mob effect applicable events.
Properties
| Property | Description |
|---|---|
entity | The living entity being checked |
effect | The effect instance being checked |
ServerMobEffectEvent.MobEffectAddArg
kotlin
data class MobEffectAddArg( val entity: LivingEntity, val effect: MobEffectInstance, val source: Entity? )Argument class for mob effect add events.
Properties
| Property | Description |
|---|---|
entity | The living entity receiving the effect |
effect | The effect instance being added |
source | The entity that caused the effect (can be null) |
ServerMobEffectEvent.MobEffectRemoveArg
kotlin
data class MobEffectRemoveArg( val entity: LivingEntity, val effect: MobEffectInstance? ): CancellableEventArg()Argument class for mob effect remove events.
Properties
| Property | Description |
|---|---|
entity | The living entity losing the effect |
effect | The effect instance being removed (can be null if removed by type) |
ServerMobEffectEvent.MobEffectExpireArg
kotlin
data class MobEffectExpireArg( val entity: LivingEntity, val effect: MobEffectInstance? ): CancellableEventArg()Argument class for mob effect expire events.
Properties
| Property | Description |
|---|---|
entity | The living entity whose effect expired |
effect | The effect instance that expired (can be null) |