Interface Wither

All Superinterfaces:
Attributable, Audience, Boss, CommandSender, Creature, Damageable, Enemy, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Leashable, LivingEntity, Lootable, Metadatable, Mob, Monster, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, RangedEntity, ServerOperator, Sound.Emitter

public interface Wither extends Monster, Boss, RangedEntity
Represents a Wither boss
  • Method Details

    • setTarget

      void setTarget(@Nullable @Nullable LivingEntity target)
      Instructs this Mob to set the specified LivingEntity as its target.

      Hostile creatures may attack their target, and friendly creatures may follow their target.

      This method will set the target of the center head of the wither.

      Specified by:
      setTarget in interface Mob
      Parameters:
      target - New LivingEntity to target, or null to clear the target
      See Also:
    • setTarget

      This method will set the target of individual heads Wither.Head of the wither.
      Parameters:
      head - the individual head
      target - the entity that should be targeted
    • getTarget

      This method will get the target of individual heads Wither.Head of the wither.
      Parameters:
      head - the individual head
      Returns:
      the entity targeted by the given head, or null if none is targeted
    • getInvulnerabilityTicks

      @Deprecated(forRemoval=true) int getInvulnerabilityTicks()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Duplicate api, use getInvulnerableTicks()
      Returns the wither's current invulnerability ticks.
      Returns:
      amount of invulnerability ticks
    • setInvulnerabilityTicks

      @Deprecated(forRemoval=true) void setInvulnerabilityTicks(int ticks)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Duplicate api, use setInvulnerableTicks(int)
      Sets the wither's current invulnerability ticks. When invulnerability ticks reach 0, the wither will trigger an explosion.
      Parameters:
      ticks - amount of invulnerability ticks
    • isCharged

      boolean isCharged()
      Returns:
      whether the wither is charged
    • getInvulnerableTicks

      int getInvulnerableTicks()
      Returns:
      ticks the wither is invulnerable for
    • setInvulnerableTicks

      void setInvulnerableTicks(int ticks)
      Sets for how long in the future, the wither should be invulnerable.
      Parameters:
      ticks - ticks the wither is invulnerable for
    • canTravelThroughPortals

      boolean canTravelThroughPortals()
      Returns:
      whether the wither can travel through portals
    • setCanTravelThroughPortals

      void setCanTravelThroughPortals(boolean value)
      Sets whether the wither can travel through portals.
      Parameters:
      value - whether the wither can travel through portals
    • enterInvulnerabilityPhase

      void enterInvulnerabilityPhase()
      Makes the wither invulnerable for 11 seconds and sets the health to one third of the max health.
      This is called in vanilla directly after spawning the wither.
    • getSummoner

      @Nullable UUID getSummoner()
      Get the player that summoned this wither
      Returns:
      UUID of summoner
    • setSummoner

      void setSummoner(@Nullable UUID summoner)
      Set the player that summoned this wither
      Parameters:
      summoner - UUID of summoner