Class LivingConversionEvent.Pre
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingConversionEvent
net.minecraftforge.event.entity.living.LivingConversionEvent.Pre
- Enclosing class:
- LivingConversionEvent
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 
Cancelable
 If cancelled, the replacement will not occur- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingConversionEventLivingConversionEvent.Post, LivingConversionEvent.PreNested 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 SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionPre(LivingEntity entity, EntityType<? extends LivingEntity> outcome, Consumer<Integer> timer) 
- 
Method SummaryModifier and TypeMethodDescriptionEntityType<? extends LivingEntity>Gets the entity type of the new entity this living entity is converting tovoidsetConversionTimer(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 thisMethods 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- 
outcome
- 
timer
 
- 
- 
Constructor Details- 
Prepublic Pre(LivingEntity entity, EntityType<? extends LivingEntity> outcome, Consumer<Integer> timer) 
 
- 
- 
Method Details- 
getOutcomeGets the entity type of the new entity this living entity is converting to- Returns:
- the entity type of the new entity
 
- 
setConversionTimerpublic 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- Parameters:
- ticks- timer ticks
 
 
-