Class LivingEvent.LivingVisibilityEvent
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.LivingEvent.LivingVisibilityEvent
- Enclosing class:
LivingEvent
LivingVisibilityEvent is fired when an LivingEntity's visibility is queried.
This event is fired whenever LivingEntity#getVisibilityPercent() is called.
This event is fired via the CommonHooks.getEntityVisibilityMultiplier(LivingEntity, Entity, double).
LivingEvent.getEntity()contains the entity that caused this event to occur.
This event is not cancellable, and is fired on the game event bus.
-
Nested Class Summary
Nested classes/interfaces inherited from class LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLivingVisibilityEvent(LivingEntity livingEntity, @Nullable Entity lookingEntity, double originalMultiplier) -
Method Summary
Methods inherited from class LivingEvent
getEntity
-
Field Details
-
visibilityModifier
private double visibilityModifier -
lookingEntity
-
-
Constructor Details
-
LivingVisibilityEvent
public LivingVisibilityEvent(LivingEntity livingEntity, @Nullable Entity lookingEntity, double originalMultiplier)
-
-
Method Details
-
modifyVisibility
public void modifyVisibility(double mod) - Parameters:
mod- Is multiplied with the current modifier
-
getVisibilityModifier
public double getVisibilityModifier()- Returns:
- The current modifier
-
getLookingEntity
- Returns:
- The entity trying to see this LivingEntity, if available
-