类 LivingConversionEvent.Pre
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.LivingConversionEvent
net.neoforged.neoforge.event.entity.living.LivingConversionEvent.Pre
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
public static class LivingConversionEvent.Pre
extends LivingConversionEvent
implements net.neoforged.bus.api.ICancellableEvent
LivingConversionEvent.Pre is triggered when an entity is trying
to replace itself with another entity
This event may trigger every tick even if it was cancelled last tick
for entities like Zombies and Hoglins. To prevent it, the conversion
timer needs to be changed or reset
This event is
ICancellableEvent
If cancelled, the replacement will not occur-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingConversionEvent
LivingConversionEvent.Post, LivingConversionEvent.Pre
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段 -
构造器概要
构造器构造器说明Pre
(LivingEntity entity, EntityType<? extends LivingEntity> outcome, Consumer<Integer> timer) -
方法概要
修饰符和类型方法说明EntityType
<? extends LivingEntity> Gets the entity type of the new entity this living entity is converting tovoid
setConversionTimer
(int ticks) Sets the conversion timer, by changing this it prevents the event being triggered every tick Do note the timer of some of the entities are increments, but some of them are decrements Not every conversion is applicable for this从类继承的方法 net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
outcome
-
timer
-
-
构造器详细资料
-
Pre
public Pre(LivingEntity entity, EntityType<? extends LivingEntity> outcome, Consumer<Integer> timer)
-
-
方法详细资料
-
getOutcome
Gets the entity type of the new entity this living entity is converting to- 返回:
- the entity type of the new entity
-
setConversionTimer
public void setConversionTimer(int ticks) Sets the conversion timer, by changing this it prevents the event being triggered every tick Do note the timer of some of the entities are increments, but some of them are decrements Not every conversion is applicable for this- 参数:
ticks
- timer ticks
-