Class LivingBreatheEvent
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.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
CommonHooks.onLivingBreathe(LivingEntity, int, int).This event is not
invalid @link
ICancellableEventThis event does not have a result.
Event.HasResult
 This event is fired on
NeoForge.EVENT_BUS- 
Nested Class SummaryNested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEventLivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEventEntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.SizeNested classes/interfaces inherited from class net.neoforged.bus.api.Eventnet.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate int
- 
Constructor SummaryConstructorsConstructorDescriptionLivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanIf the entity can breathe, their air value will be increased bygetRefillAirAmount().
 If the entity cannot breathe, their air value will be reduced bygetConsumeAirAmount().intintvoidsetCanBreathe(boolean canBreathe) Sets if the entity can breathe 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.neoforged.neoforge.event.entity.living.LivingEventgetEntityMethods inherited from class net.neoforged.bus.api.EventgetResult, hasResult, setResult
- 
Field Details- 
canBreatheprivate boolean canBreathe
- 
consumeAirAmountprivate int consumeAirAmount
- 
refillAirAmountprivate int refillAirAmount
 
- 
- 
Constructor Details- 
LivingBreatheEventpublic LivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount) 
 
- 
- 
Method Details- 
canBreathepublic boolean canBreathe()If the entity can breathe, their air value will be increased bygetRefillAirAmount().
 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.
 
- 
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:
 
 
-