Contents
Class BreathingCheckEvent
java.lang.Object
com.hypixel.hytale.component.system.EcsEvent
com.hypixel.hytale.server.core.event.events.ecs.BreathingCheckEvent
An event that is fired when the block material or fluid at an entity's breathing height changes.
The canBreathe() value is initialized with the vanilla breathing result. Event handlers
can override it via setCanBreathe(boolean) to customize breathing behavior for specific
entity types (e.g. NPCs that can breathe underwater).
-
Constructor Summary
ConstructorsConstructorDescriptionBreathingCheckEvent(BlockMaterial breathingMaterial, int fluidId, boolean canBreathe) Default Constructor for aBreathingCheckEventinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintvoidsetCanBreathe(boolean canBreathe) Sets whether the entity can breathe.
-
Constructor Details
-
BreathingCheckEvent
public BreathingCheckEvent(@Nonnull BlockMaterial breathingMaterial, int fluidId, boolean canBreathe) Default Constructor for aBreathingCheckEventinstance.- Parameters:
breathingMaterial- The block material at the entity's breathing height.fluidId- The fluid ID at the entity's breathing height.canBreathe- The default breathing result from vanilla logic.
-
-
Method Details
-
getBreathingMaterial
- Returns:
- the block material at the entity's breathing height.
-
getFluidId
public int getFluidId()- Returns:
- the fluid ID at the entity's breathing height.
-
canBreathe
public boolean canBreathe()- Returns:
trueif the entity can breathe,falseotherwise.
-
setCanBreathe
public void setCanBreathe(boolean canBreathe) Sets whether the entity can breathe.- Parameters:
canBreathe- Whether the entity can breathe.
-