接口 ServerEvents.LivingEntity.Effect.Add
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
-
方法概要
修饰符和类型方法说明booleanaddEffect(net.minecraft.world.entity.LivingEntity affectedEntity, @NotNull net.minecraft.world.effect.MobEffectInstance effect, net.minecraft.world.entity.Entity sourceEntity) Called when an effect is about to be applied to an entity.
-
方法详细资料
-
addEffect
boolean addEffect(@NotNull net.minecraft.world.entity.LivingEntity affectedEntity, @NotNull @NotNull net.minecraft.world.effect.MobEffectInstance effect, @Nullable net.minecraft.world.entity.Entity sourceEntity) Called when an effect is about to be applied to an entity.- 参数:
affectedEntity- the entity to which the effect will be appliedeffect- the effect instance to be appliedsourceEntity- the entity causing the effect, ornullif no source is specified- 返回:
trueif the effect should be applied, otherwisefalse
-