Class MobEffectEvent.Added
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.Added
- Enclosing class:
MobEffectEvent
This event is fired when a new
MobEffectInstance
is added to an entity.
This event is also fired if an entity already has the effect but with a different duration or amplifier.
This event is not ICancellableEvent
.
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
ConstructorDescriptionAdded
(LivingEntity living, MobEffectInstance oldEffectInstance, MobEffectInstance newEffectInstance, Entity source) -
Method Summary
Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
-
Field Details
-
oldEffectInstance
-
source
-
-
Constructor Details
-
Added
@Internal public Added(LivingEntity living, MobEffectInstance oldEffectInstance, MobEffectInstance newEffectInstance, Entity source)
-
-
Method Details
-
getEffectInstance
- Overrides:
getEffectInstance
in classMobEffectEvent
- Returns:
- the added
MobEffectInstance
. This is the unmerged MobEffectInstance if the old MobEffectInstance is not null.
-
getOldEffectInstance
- Returns:
- the old
MobEffectInstance
. This can be null if the entity did not have an effect of this kind before.
-
getEffectSource
- Returns:
- the entity source of the effect, or
null
if none exists
-