类 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
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明private boolean
private boolean
private int
private int
-
构造器概要
构造器构造器说明LivingBreatheEvent
(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount, boolean canRefillAir) -
方法概要
修饰符和类型方法说明boolean
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()
.boolean
If the entity can breathe,canRefillAir()
will be checked to see if their air value should be refilled.int
int
void
setCanBreathe
(boolean canBreathe) Sets if the entity can breathe or not.void
setCanRefillAir
(boolean canRefillAir) Sets if the entity can refill its air value or not.void
setConsumeAirAmount
(int consumeAirAmount) Sets the new consumed air amount.void
setRefillAirAmount
(int refillAirAmount) Sets the new refilled air amount.从类继承的方法 net.minecraftforge.event.entity.living.LivingEvent
getEntity
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
canBreathe
private boolean canBreathe -
canRefillAir
private boolean canRefillAir -
consumeAirAmount
private int consumeAirAmount -
refillAirAmount
private int refillAirAmount
-
-
构造器详细资料
-
LivingBreatheEvent
@Internal public LivingBreatheEvent(LivingEntity entity, boolean canBreathe, int consumeAirAmount, int refillAirAmount, boolean canRefillAir)
-
-
方法详细资料
-
canBreathe
public 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()
.- 返回:
- True if the entity can breathe
-
setCanBreathe
public void setCanBreathe(boolean canBreathe) Sets if the entity can breathe or not.- 参数:
canBreathe
- The new value.
-
canRefillAir
public boolean canRefillAir()If the entity can breathe,canRefillAir()
will be checked to see if their air value should be refilled.- 返回:
- True if the entity can refill its air value
-
setCanRefillAir
public void setCanRefillAir(boolean canRefillAir) Sets if the entity can refill its air value or not.- 参数:
canRefillAir
- 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.- 另请参阅:
-