Class MobEffectEvent.Remove

All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
MobEffectEvent

public static class MobEffectEvent.Remove extends MobEffectEvent implements net.neoforged.bus.api.ICancellableEvent
This Event is fired when a MobEffect is about to get removed from an Entity. This Event is ICancellableEvent. If canceled, the effect will not be removed. This Event does not have a result.
  • Field Details

    • effect

      private final net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect
  • Constructor Details

    • Remove

      @Internal public Remove(net.minecraft.world.entity.LivingEntity living, net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect)
    • Remove

      @Internal public Remove(net.minecraft.world.entity.LivingEntity living, net.minecraft.world.effect.MobEffectInstance effectInstance)
  • Method Details

    • getEffect

      public net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> getEffect()
      Returns:
      the MobEffect which is being removed from the entity
    • getEffectInstance

      @Nullable public @Nullable net.minecraft.world.effect.MobEffectInstance getEffectInstance()
      Overrides:
      getEffectInstance in class MobEffectEvent
      Returns:
      the MobEffectInstance. In the remove event, this can be null if the entity does not have a MobEffect of the right type active.