Interface BossBar

All Known Subinterfaces:
KeyedBossBar

public interface BossBar
Since:
1.9.4
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFlag(@NotNull BarFlag flag)
    Add an optional flag to this boss bar
    void
    addPlayer(@NotNull Player player)
    Adds the player to this boss bar causing it to display on their screen.
    @NotNull BarColor
    Returns the color of this boss bar
    @NotNull List<Player>
    Returns all players viewing this boss bar
    double
    Returns the progress of the bar between 0.0 and 1.0
    @NotNull BarStyle
    Returns the style of this boss bar
    @NotNull String
    Returns the title of this boss bar
    boolean
    hasFlag(@NotNull BarFlag flag)
    Returns whether this boss bar as the passed flag set
    void
    Deprecated.
    boolean
    Return if the boss bar is displayed to attached players.
    void
    Removes all players from this boss bar
    void
    removeFlag(@NotNull BarFlag flag)
    Remove an existing flag on this boss bar
    void
    removePlayer(@NotNull Player player)
    Removes the player from this boss bar causing it to be removed from their screen.
    void
    setColor(@NotNull BarColor color)
    Sets the color of this boss bar.
    void
    setProgress(double progress)
    Sets the progress of the bar.
    void
    setStyle(@NotNull BarStyle style)
    Sets the bar style of this boss bar
    void
    setTitle(@Nullable String title)
    Sets the title of this boss bar
    void
    setVisible(boolean visible)
    Set if the boss bar is displayed to attached players.
    void
    Deprecated.
  • Method Details

    • getTitle

      @NotNull @NotNull String getTitle()
      Returns the title of this boss bar
      Returns:
      the title of the bar
      Since:
      1.9.4
    • setTitle

      void setTitle(@Nullable @Nullable String title)
      Sets the title of this boss bar
      Parameters:
      title - the title of the bar
      Since:
      1.9.4
    • getColor

      @NotNull @NotNull BarColor getColor()
      Returns the color of this boss bar
      Returns:
      the color of the bar
      Since:
      1.9.4
    • setColor

      void setColor(@NotNull @NotNull BarColor color)
      Sets the color of this boss bar.
      Parameters:
      color - the color of the bar
      Since:
      1.9.4
    • getStyle

      @NotNull @NotNull BarStyle getStyle()
      Returns the style of this boss bar
      Returns:
      the style of the bar
      Since:
      1.9.4
    • setStyle

      void setStyle(@NotNull @NotNull BarStyle style)
      Sets the bar style of this boss bar
      Parameters:
      style - the style of the bar
      Since:
      1.9.4
    • removeFlag

      void removeFlag(@NotNull @NotNull BarFlag flag)
      Remove an existing flag on this boss bar
      Parameters:
      flag - the existing flag to remove
      Since:
      1.9.4
    • addFlag

      void addFlag(@NotNull @NotNull BarFlag flag)
      Add an optional flag to this boss bar
      Parameters:
      flag - an optional flag to set on the boss bar
      Since:
      1.9.4
    • hasFlag

      boolean hasFlag(@NotNull @NotNull BarFlag flag)
      Returns whether this boss bar as the passed flag set
      Parameters:
      flag - the flag to check
      Returns:
      whether it has the flag
      Since:
      1.9.4
    • setProgress

      void setProgress(double progress)
      Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full)
      Parameters:
      progress - the progress of the bar
      Since:
      1.9.4
    • getProgress

      double getProgress()
      Returns the progress of the bar between 0.0 and 1.0
      Returns:
      the progress of the bar
      Since:
      1.9.4
    • addPlayer

      void addPlayer(@NotNull @NotNull Player player)
      Adds the player to this boss bar causing it to display on their screen.
      Parameters:
      player - the player to add
      Since:
      1.9.4
    • removePlayer

      void removePlayer(@NotNull @NotNull Player player)
      Removes the player from this boss bar causing it to be removed from their screen.
      Parameters:
      player - the player to remove
      Since:
      1.9.4
    • removeAll

      void removeAll()
      Removes all players from this boss bar
      Since:
      1.9.4
      See Also:
    • getPlayers

      @NotNull @NotNull List<Player> getPlayers()
      Returns all players viewing this boss bar
      Returns:
      a immutable list of players
      Since:
      1.9.4
    • setVisible

      void setVisible(boolean visible)
      Set if the boss bar is displayed to attached players.
      Parameters:
      visible - visible status
      Since:
      1.9.4
    • isVisible

      boolean isVisible()
      Return if the boss bar is displayed to attached players.
      Returns:
      visible status
      Since:
      1.9.4
    • show

      @Deprecated(since="1.9") void show()
      Deprecated.
      Shows the previously hidden boss bar to all attached players
      Since:
      1.9.4
    • hide

      @Deprecated(since="1.9") void hide()
      Deprecated.
      Hides this boss bar from all attached players
      Since:
      1.9.4