Interface Hoglin

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

public interface Hoglin extends Animals, Enemy
Represents a Hoglin.
  • Method Details

    • isImmuneToZombification

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

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

      boolean isAbleToBeHunted()
      Get whether the hoglin is able to be hunted by piglins.
      Returns:
      Whether the hoglin is able to be hunted by piglins
    • setIsAbleToBeHunted

      void setIsAbleToBeHunted(boolean flag)
      Sets whether the hoglin is able to be hunted by piglins.
      Parameters:
      flag - Whether the hoglin is able to be hunted by piglins.
    • getConversionTime

      int getConversionTime()
      Gets the amount of ticks until this entity will be converted to a Zoglin. 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 Hoglin 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 Zoglin.
      Returns:
      conversion status