Class MobEffectEvent.Added
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.MobEffectEvent
net.minecraftforge.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 Cancelable
.
This event does not have a result.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.MobEffectEvent
MobEffectEvent.Added, MobEffectEvent.Applicable, MobEffectEvent.Expired, MobEffectEvent.Remove
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Fields inherited from class net.minecraftforge.event.entity.living.MobEffectEvent
effectInstance
-
Constructor Summary
ConstructorDescriptionAdded
(LivingEntity living, MobEffectInstance oldEffectInstance, MobEffectInstance newEffectInstance, Entity source) -
Method Summary
Modifier and TypeMethodDescription@NotNull MobEffectInstance
@Nullable Entity
@Nullable MobEffectInstance
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
oldEffectInstance
-
source
-
-
Constructor Details
-
Added
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
-