Class MobEffectEvent.Applicable
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.Applicable
- Enclosing class:
MobEffectEvent
This event is fired to check if a
MobEffectInstance
can be applied to an entity.
It will be fired whenever LivingEntity.canBeAffected(MobEffectInstance)
would be invoked.
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionprotected MobEffectEvent.Applicable.Result
private final @Nullable Entity
Fields inherited from class net.neoforged.neoforge.event.entity.living.MobEffectEvent
effectInstance
-
Constructor Summary
ConstructorsConstructorDescriptionApplicable
(LivingEntity living, MobEffectInstance effectInstance, @Nullable Entity source) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns If the mob effect should be applied or not, based on the current event result.@Nullable Entity
Returns the result of this event, which controls if the mob effect will be applied.void
Changes the result of this event.Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
-
Field Details
-
result
-
source
-
-
Constructor Details
-
Applicable
@Internal public Applicable(LivingEntity living, MobEffectInstance effectInstance, @Nullable @Nullable Entity source)
-
-
Method Details
-
getEffectInstance
- Overrides:
getEffectInstance
in classMobEffectEvent
-
setResult
Changes the result of this event. -
getResult
Returns the result of this event, which controls if the mob effect will be applied.- Returns:
- the result of this event, which controls if the mob effect will be applied
-
getEffectSource
- Returns:
- the entity source of the effect, or
null
if none exists
-
getApplicationResult
public boolean getApplicationResult()Returns If the mob effect should be applied or not, based on the current event result.- Returns:
- If the mob effect should be applied or not, based on the current event result
-