Interface Zombie

All Superinterfaces:
Ageable, Attributable, Audience, CommandSender, Creature, Damageable, DataComponentView, Enemy, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Leashable, LivingEntity, Lootable, Metadatable, Mob, Monster, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, ServerOperator, Sound.Emitter
All Known Subinterfaces:
Drowned, Husk, PigZombie, ZombieVillager

public interface Zombie extends Monster, Ageable
Represents a Zombie.
Since:
1.0.0
  • Method Details

    • isBaby

      @Deprecated(since="1.16.2") boolean isBaby()
      Deprecated.
      Gets whether the zombie is a baby
      Returns:
      Whether the zombie is a baby
      Since:
      1.4.5
    • setBaby

      @Deprecated(since="1.16.2") void setBaby(boolean baby)
      Sets whether the zombie is a baby
      Parameters:
      baby - Whether the zombie is a baby
      Since:
      1.4.5
    • isVillager

      @Deprecated(since="1.10.2", forRemoval=true) boolean isVillager()
      Deprecated, for removal: This API element is subject to removal in a future version.
      check if instanceof ZombieVillager.
      Gets whether the zombie is a villager
      Returns:
      Whether the zombie is a villager
    • setVillager

      @Deprecated(since="1.9", forRemoval=true) @Contract("_ -> fail") void setVillager(boolean flag)
      Deprecated, for removal: This API element is subject to removal in a future version.
      must spawn ZombieVillager.
      Parameters:
      flag - flag
    • setVillagerProfession

      @Deprecated(since="1.10.2", forRemoval=true) @Contract("_ -> fail") void setVillagerProfession(Villager.Profession profession)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      profession - profession
      See Also:
    • getVillagerProfession

      @Deprecated(since="1.10.2", forRemoval=true) @Nullable @Contract("-> null") Villager.Profession getVillagerProfession()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      profession
      See Also:
    • isConverting

      boolean isConverting()
      Get if this entity is in the process of converting to a Drowned as a result of being underwater.
      Returns:
      conversion status
      Since:
      1.13.2
    • getConversionTime

      int getConversionTime()
      Gets the amount of ticks until this entity will be converted to a Drowned as a result of being underwater.
      When this reaches 0, the entity will be converted.
      Returns:
      conversion time
      Throws:
      IllegalStateException - if isConverting() is false.
      Since:
      1.13.2
    • setConversionTime

      void setConversionTime(int time)
      Sets the amount of ticks until this entity will be converted to a Drowned as a result of being underwater.
      When this reaches 0, the entity will be converted. A value of less than 0 will stop the current conversion process without converting the current entity.
      Parameters:
      time - new conversion time
      Since:
      1.13.2
    • canBreakDoors

      boolean canBreakDoors()
      Gets whether this zombie can break doors
      Returns:
      Whether this zombie can break doors
      Since:
      1.16.4
    • setCanBreakDoors

      void setCanBreakDoors(boolean flag)
      Sets whether this zombie can break doors

      Check supportsBreakingDoors() to see if this zombie type will even be affected by using this method. Will also stop the action if the entity is currently breaking a door.

      Parameters:
      flag - Whether this zombie can break doors
      Since:
      1.16.4
    • isDrowning

      boolean isDrowning()
      Check if zombie is drowning
      Returns:
      True if zombie conversion process has begun
      Since:
      1.13.2
    • startDrowning

      @Deprecated void startDrowning(int drownedConversionTime)
      Deprecated.
      Make zombie start drowning
      Parameters:
      drownedConversionTime - Amount of time until zombie converts from drowning
      Since:
      1.13.2
    • stopDrowning

      void stopDrowning()
      Stop a zombie from starting the drowning conversion process
      Since:
      1.13.2
    • setArmsRaised

      @Deprecated void setArmsRaised(boolean raised)
      Set if zombie has its arms raised
      Parameters:
      raised - True to raise arms
      Since:
      1.13.2
    • isArmsRaised

      @Deprecated boolean isArmsRaised()
      Deprecated.
      Check if zombie has arms raised
      Returns:
      True if arms are raised
      Since:
      1.13.2
    • shouldBurnInDay

      boolean shouldBurnInDay()
      Check if this zombie will burn in the sunlight
      Returns:
      True if zombie will burn in sunlight
      Since:
      1.13.2
    • setShouldBurnInDay

      void setShouldBurnInDay(boolean shouldBurnInDay)
      Set if this zombie should burn in the sunlight
      Parameters:
      shouldBurnInDay - True to burn in sunlight
      Since:
      1.13.2
    • supportsBreakingDoors

      @Deprecated(since="1.21.2", forRemoval=true) default boolean supportsBreakingDoors()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since 1.21.2 all zombie types can break doors if instructed as MC-137053 was fixed.
      Checks if this zombie type supports breaking doors. Drowned do not have support for breaking doors so using setCanBreakDoors(boolean) on them has no effect.
      Returns:
      true if entity supports breaking doors