Skip to content
On this page
NeoForge

ServerMobEffectEvent

top.katton.api.eventneoforge/src/main/kotlin/top/katton/api/event/ServerMobEffectEvent.kt
NeoForge 平台的状态效果事件。 此对象提供与状态效果(药水)相关的事件,包括添加、移除、过期以及检查效果是否适用。

ServerMobEffectEvent

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

NeoForge 平台的状态效果事件。 此对象提供与状态效果(药水)相关的事件,包括添加、移除、过期以及检查效果是否适用。

ServerMobEffectEvent.onMobEffectApplicable

ServerMobEffectEvent.onMobEffectApplicableNeoForge属性
kotlin
val onMobEffectApplicable

当检查某个状态效果是否可以应用到实体时触发。

ServerMobEffectEvent.onMobEffectAdd

ServerMobEffectEvent.onMobEffectAddNeoForge属性
kotlin
val onMobEffectAdd

当向实体添加状态效果时触发。

ServerMobEffectEvent.onMobEffectRemove

ServerMobEffectEvent.onMobEffectRemoveNeoForge属性
kotlin
val onMobEffectRemove

当从实体移除状态效果时触发。 可取消以阻止移除。

ServerMobEffectEvent.onMobEffectExpire

ServerMobEffectEvent.onMobEffectExpireNeoForge属性
kotlin
val onMobEffectExpire

当实体身上的状态效果过期时触发。 可取消以阻止过期。

ServerMobEffectEvent.MobEffectApplicableArg

ServerMobEffectEvent.MobEffectApplicableArgNeoForge数据类
kotlin
data class MobEffectApplicableArg( val entity: LivingEntity, val effect: MobEffectInstance )

状态效果适用性检查事件的参数类。

属性

属性说明
entity正在检查的生物实体。
effect正在检查的效果实例。

ServerMobEffectEvent.MobEffectAddArg

ServerMobEffectEvent.MobEffectAddArgNeoForge数据类
kotlin
data class MobEffectAddArg( val entity: LivingEntity, val effect: MobEffectInstance, val source: Entity? )

状态效果添加事件的参数类。

属性

属性说明
entity正在接收效果的生物实体。
effect正在添加的效果实例。
source造成该效果的实体,可为 null。

ServerMobEffectEvent.MobEffectRemoveArg

ServerMobEffectEvent.MobEffectRemoveArgNeoForge数据类
kotlin
data class MobEffectRemoveArg( val entity: LivingEntity, val effect: MobEffectInstance? ): CancellableEventArg()

状态效果移除事件的参数类。

属性

属性说明
entity失去该效果的生物实体。
effect正在移除的效果实例。如果是按类型移除,这里可以为 null。

ServerMobEffectEvent.MobEffectExpireArg

ServerMobEffectEvent.MobEffectExpireArgNeoForge数据类
kotlin
data class MobEffectExpireArg( val entity: LivingEntity, val effect: MobEffectInstance? ): CancellableEventArg()

状态效果过期事件的参数类。

属性

属性说明
entity效果过期的生物实体。
effect已过期的效果实例,可为 null。