接口 ServerEvents.LivingEntity.Effect.Override
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
-
方法概要
修饰符和类型方法说明booleanoverrideEffect(net.minecraft.world.entity.LivingEntity affectedEntity, @NotNull net.minecraft.world.effect.MobEffectInstance oldEffect, @NotNull net.minecraft.world.effect.MobEffectInstance newEffect, net.minecraft.world.entity.Entity sourceEntity, boolean override) Called to determine whether a new effect should override an existing effect.
-
方法详细资料
-
overrideEffect
boolean overrideEffect(@NotNull net.minecraft.world.entity.LivingEntity affectedEntity, @NotNull @NotNull net.minecraft.world.effect.MobEffectInstance oldEffect, @NotNull @NotNull net.minecraft.world.effect.MobEffectInstance newEffect, @Nullable net.minecraft.world.entity.Entity sourceEntity, boolean override) Called to determine whether a new effect should override an existing effect.- 参数:
affectedEntity- the entity with the existing effectoldEffect- the current effect instancenewEffect- the new effect instance to applysourceEntity- the entity causing the effect, ornullif no source is specifiedoverride- whether the effect should be overridden- 返回:
trueif the effect should be overridden, otherwisefalse
-