Class LivingBreatheEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingBreatheEvent
LivingBreatheEvent is fired whenever a living entity ticks.
 
This event is fired via
 
This event is not
 
This event does not have a result.
This event is fired on
This event is fired via
ForgeHooks.onLivingBreathe(LivingEntity, int, int).This event is not
Cancelable.This event does not have a result.
Event.HasResult
 This event is fired on
MinecraftForge.EVENT_BUS- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEventLivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEventEntityEvent.EnteringSection, EntityEvent.EntityConstructingNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate intprivate int
- 
Constructor SummaryConstructorsConstructorDescriptionLivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount) Deprecated, for removal: This API element is subject to removal in a future version.LivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount, boolean canRefillAir) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanIf the entity can breathe andcanRefillAir()returns true, their air value will be increased bygetRefillAirAmount().
 If the entity can breathe andcanRefillAir()returns false, their air value will stay the same.
 If the entity cannot breathe, their air value will be reduced bygetConsumeAirAmount().booleanIf the entity can breathe,canRefillAir()will be checked to see if their air value should be refilled.intintvoidsetCanBreathe(boolean canBreathe) Sets if the entity can breathe or not.voidsetCanRefillAir(boolean canRefillAir) Sets if the entity can refill its air value or not.voidsetConsumeAirAmount(int consumeAirAmount) Sets the new consumed air amount.voidsetRefillAirAmount(int refillAirAmount) Sets the new refilled air amount.Methods inherited from class net.minecraftforge.event.entity.living.LivingEventgetEntityMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
canBreatheprivate boolean canBreathe
- 
canRefillAirprivate boolean canRefillAir
- 
consumeAirAmountprivate int consumeAirAmount
- 
refillAirAmountprivate int refillAirAmount
 
- 
- 
Constructor Details- 
LivingBreatheEvent@Internal @Deprecated(forRemoval=true, since="1.20.1") public LivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount) Deprecated, for removal: This API element is subject to removal in a future version.
- 
LivingBreatheEvent@Internal public LivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount, boolean canRefillAir) 
 
- 
- 
Method Details- 
canBreathepublic boolean canBreathe()If the entity can breathe andcanRefillAir()returns true, their air value will be increased bygetRefillAirAmount().
 If the entity can breathe andcanRefillAir()returns false, their air value will stay the same.
 If the entity cannot breathe, their air value will be reduced bygetConsumeAirAmount().- Returns:
- True if the entity can breathe
 
- 
setCanBreathepublic void setCanBreathe(boolean canBreathe) Sets if the entity can breathe or not.- Parameters:
- canBreathe- The new value.
 
- 
canRefillAirpublic boolean canRefillAir()If the entity can breathe,canRefillAir()will be checked to see if their air value should be refilled.- Returns:
- True if the entity can refill its air value
 
- 
setCanRefillAirpublic void setCanRefillAir(boolean canRefillAir) Sets if the entity can refill its air value or not.- Parameters:
- canRefillAir- The new value.
 
- 
getConsumeAirAmountpublic int getConsumeAirAmount()- Returns:
- The amount the entity's air supply will be reduced by if the entity cannot breathe.
 
- 
setConsumeAirAmountpublic void setConsumeAirAmount(int consumeAirAmount) Sets the new consumed air amount.- Parameters:
- consumeAirAmount- The new value.
- See Also:
 
- 
getRefillAirAmountpublic int getRefillAirAmount()- Returns:
- The amount the entity's air supply will be increased by if the entity can breathe.
 
- 
setRefillAirAmountpublic void setRefillAirAmount(int refillAirAmount) Sets the new refilled air amount.- Parameters:
- refillAirAmount- The new value.
- See Also:
 
 
-