Interface ServerEvents.LivingEntity.Effect.Override

Enclosing class:
ServerEvents.LivingEntity.Effect
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ServerEvents.LivingEntity.Effect.Override
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    overrideEffect(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.
  • Method Details

    • 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.
      Parameters:
      affectedEntity - the entity with the existing effect
      oldEffect - the current effect instance
      newEffect - the new effect instance to apply
      sourceEntity - the entity causing the effect, or null if no source is specified
      override - whether the effect should be overridden
      Returns:
      true if the effect should be overridden, otherwise false