Class PotionEvent.PotionAddedEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.EntityEvent
-
- net.minecraftforge.event.entity.living.LivingEvent
-
- net.minecraftforge.event.entity.living.PotionEvent
-
- net.minecraftforge.event.entity.living.PotionEvent.PotionAddedEvent
-
- Enclosing class:
- PotionEvent
public static class PotionEvent.PotionAddedEvent extends PotionEvent
This Event is fired when a new Potion is added to the Entity. This is also fired if the Entity already has this effect but with different duration/level. This Event is notCancelable
This Event does not have a Result.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.PotionEvent
PotionEvent.PotionAddedEvent, PotionEvent.PotionApplicableEvent, PotionEvent.PotionExpiryEvent, PotionEvent.PotionRemoveEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private EffectInstance
oldEffect
-
Fields inherited from class net.minecraftforge.event.entity.living.PotionEvent
effect
-
-
Constructor Summary
Constructors Constructor Description PotionAddedEvent(LivingEntity living, EffectInstance oldEffect, EffectInstance newEffect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EffectInstance
getOldPotionEffect()
EffectInstance
getPotionEffect()
Retuns the PotionEffect.-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
oldEffect
private final EffectInstance oldEffect
-
-
Constructor Detail
-
PotionAddedEvent
public PotionAddedEvent(LivingEntity living, EffectInstance oldEffect, EffectInstance newEffect)
-
-
Method Detail
-
getPotionEffect
@Nonnull public EffectInstance getPotionEffect()
Description copied from class:PotionEvent
Retuns the PotionEffect.- Overrides:
getPotionEffect
in classPotionEvent
- Returns:
- the added PotionEffect. This is the umerged PotionEffect if the old PotionEffect is not null.
-
getOldPotionEffect
@Nullable public EffectInstance getOldPotionEffect()
- Returns:
- the old PotionEffect. THis can be null if the entity did not have an effect of this kind before.
-
-