Interface Wither

All Superinterfaces:
Attributable, Audience, Boss, CommandSender, Creature, Damageable, DataComponentView, 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
Since:
1.4.5
  • 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
      Since:
      1.18.2
      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
      Since:
      1.18.2
    • 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
      Since:
      1.18.2
    • 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
      Since:
      1.16.5
    • getInvulnerableTicks

      int getInvulnerableTicks()
      Returns:
      ticks the wither is invulnerable for
      Since:
      1.16.5
    • 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
      Since:
      1.16.5
    • canTravelThroughPortals

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

      void setCanTravelThroughPortals(boolean value)
      Sets whether the wither can travel through portals.
      Parameters:
      value - whether the wither can travel through portals
      Since:
      1.16.5
    • 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.
      Since:
      1.19.4