Interface PiglinAbstract

All Superinterfaces:
Ageable, Attributable, Audience, CommandSender, Creature, Damageable, Enemy, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, LivingEntity, Lootable, Metadatable, Mob, Monster, Nameable, Permissible, PersistentDataHolder, Pointered, ProjectileSource, ServerOperator, Sound.Emitter
All Known Subinterfaces:
Piglin, PiglinBrute

public interface PiglinAbstract extends Monster, Ageable
Piglin / Piglin Brute.
  • Method Details

    • isImmuneToZombification

      boolean isImmuneToZombification()
      Gets whether the piglin is immune to zombification.
      Returns:
      Whether the piglin is immune to zombification
    • setImmuneToZombification

      void setImmuneToZombification(boolean flag)
      Sets whether the piglin is immune to zombification.
      Parameters:
      flag - Whether the piglin is immune to zombification
    • getConversionTime

      int getConversionTime()
      Gets the amount of ticks until this entity will be converted to a Zombified Piglin. When this reaches 300, the entity will be converted.
      Returns:
      conversion time
      Throws:
      IllegalStateException - if isConverting() is false.
    • setConversionTime

      void setConversionTime(int time)
      Sets the conversion counter value. The counter is incremented every tick the method isConverting() returns true. Setting this value will not start the conversion if the PiglinAbstract is not in a valid environment (World.isPiglinSafe()) to convert, is immune to zombification (isImmuneToZombification()) or has no AI (LivingEntity.hasAI()). When this reaches 300, the entity will be converted. To stop the conversion use setImmuneToZombification(boolean).
      Parameters:
      time - new conversion counter
    • isConverting

      boolean isConverting()
      Get if this entity is in the process of converting to a Zombified Piglin.
      Returns:
      conversion status
    • isBaby

      @Deprecated boolean isBaby()
      Deprecated.
      Gets whether the piglin is a baby
      Returns:
      Whether the piglin is a baby
    • setBaby

      @Deprecated void setBaby(boolean flag)
      Sets whether the piglin is a baby
      Parameters:
      flag - Whether the piglin is a baby