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
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 not
Cancelable
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.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
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.PotionEvent
effect
-
Constructor Summary
ConstructorDescriptionPotionAddedEvent
(LivingEntity living, MobEffectInstance oldEffect, MobEffectInstance newEffect, Entity source) -
Method Summary
Modifier and TypeMethodDescriptionRetuns the PotionEffect.Returns the entity source of the effect, ornull
if none exists.Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
oldEffect
-
source
-
-
Constructor Details
-
PotionAddedEvent
public PotionAddedEvent(LivingEntity living, MobEffectInstance oldEffect, MobEffectInstance newEffect, Entity source)
-
-
Method Details
-
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
- Returns:
- the old PotionEffect. THis can be null if the entity did not have an effect of this kind before.
-
getPotionSource
Returns the entity source of the effect, ornull
if none exists.- Returns:
- the entity source of the effect, or
null
-