Class MobEffectEvent.Remove
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.living.MobEffectEvent
net.neoforged.neoforge.event.entity.living.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.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.MobEffectEvent
MobEffectEvent.Added, MobEffectEvent.Applicable, MobEffectEvent.Expired, MobEffectEvent.Remove
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Field Summary
Fields inherited from class net.neoforged.neoforge.event.entity.living.MobEffectEvent
effectInstance
-
Constructor Summary
ConstructorDescriptionRemove
(LivingEntity living, Holder<MobEffect> effect, @Nullable EffectCure cure) Remove
(LivingEntity living, MobEffectInstance effectInstance, @Nullable EffectCure cure) -
Method Summary
Modifier and TypeMethodDescription@Nullable EffectCure
getCure()
Returns theEffectCure
the effect is being cured by. Null if the effect is not removed due to being cured.@Nullable MobEffectInstance
Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
effect
-
cure
-
-
Constructor Details
-
Remove
@Internal public Remove(LivingEntity living, Holder<MobEffect> effect, @Nullable @Nullable EffectCure cure) -
Remove
@Internal public Remove(LivingEntity living, MobEffectInstance effectInstance, @Nullable @Nullable EffectCure cure)
-
-
Method Details
-
getEffect
- Returns:
- the
MobEffect
which is being removed from the entity
-
getCure
Returns theEffectCure
the effect is being cured by. Null if the effect is not removed due to being cured.- Returns:
- the
EffectCure
the effect is being cured by. Null if the effect is not removed due to being cured
-
getEffectInstance
- Overrides:
getEffectInstance
in classMobEffectEvent
- Returns:
- the
MobEffectInstance
. In the remove event, this can be null if the entity does not have aMobEffect
of the right type active.
-