Class LivingConversionEvent.Pre

Enclosing class:
LivingConversionEvent

public static class LivingConversionEvent.Pre extends 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
  • Field Details

  • Constructor Details

  • Method Details

    • getOutcome

      public EntityType<? extends LivingEntity> getOutcome()
      Gets the entity type of the new entity this living entity is converting to
      Returns:
      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
      Parameters:
      ticks - timer ticks