类 LivingBreatheEvent

java.lang.Object
net.neoforged.bus.api.Event

public class LivingBreatheEvent extends LivingEvent
LivingBreatheEvent is fired whenever a living entity ticks.

This event is fired via CommonHooks.onLivingBreathe(LivingEntity, int, int).

This event is not
引用无效
ICancellableEvent
.

This event does not have a result.
引用无效
HasResult

This event is fired on NeoForge.EVENT_BUS
  • 字段详细资料

    • canBreathe

      private boolean canBreathe
    • consumeAirAmount

      private int consumeAirAmount
    • refillAirAmount

      private int refillAirAmount
  • 构造器详细资料

    • LivingBreatheEvent

      public LivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount)
  • 方法详细资料

    • canBreathe

      public boolean canBreathe()
      If the entity can breathe, their air value will be increased by getRefillAirAmount().
      If the entity cannot breathe, their air value will be reduced by getConsumeAirAmount().
      返回:
      True if the entity can breathe
    • setCanBreathe

      public void setCanBreathe(boolean canBreathe)
      Sets if the entity can breathe or not.
      参数:
      canBreathe - The new value.
    • getConsumeAirAmount

      public int getConsumeAirAmount()
      返回:
      The amount the entity's air supply will be reduced by if the entity cannot breathe.
    • setConsumeAirAmount

      public void setConsumeAirAmount(int consumeAirAmount)
      Sets the new consumed air amount.
      参数:
      consumeAirAmount - The new value.
      另请参阅:
    • getRefillAirAmount

      public int getRefillAirAmount()
      返回:
      The amount the entity's air supply will be increased by if the entity can breathe.
    • setRefillAirAmount

      public void setRefillAirAmount(int refillAirAmount)
      Sets the new refilled air amount.
      参数:
      refillAirAmount - The new value.
      另请参阅: