Interface BossBar

All Superinterfaces:
net.kyori.examination.Examinable

public interface BossBar
extends net.kyori.examination.Examinable
A bossbar.
Since:
4.0.0
  • Field Details

  • Method Details

    • bossBar

      static @NonNull BossBar bossBar​(@NonNull ComponentLike name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay)
      Creates a new bossbar.
      Parameters:
      name - the name
      progress - the progress, between 0 and 1
      color - the color
      overlay - the overlay
      Returns:
      a bossbar
      Throws:
      IllegalArgumentException - if progress is less than 0 or greater than 1
      Since:
      4.3.0
    • bossBar

      static @NonNull BossBar bossBar​(@NonNull Component name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay)
      Creates a new bossbar.
      Parameters:
      name - the name
      progress - the progress, between 0 and 1
      color - the color
      overlay - the overlay
      Returns:
      a bossbar
      Throws:
      IllegalArgumentException - if progress is less than 0 or greater than 1
      Since:
      4.0.0
    • bossBar

      static @NonNull BossBar bossBar​(@NonNull ComponentLike name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay, @NonNull Set<BossBar.Flag> flags)
      Creates a new bossbar.
      Parameters:
      name - the name
      progress - the progress, between 0 and 1
      color - the color
      overlay - the overlay
      flags - the flags
      Returns:
      a bossbar
      Throws:
      IllegalArgumentException - if progress is less than 0 or greater than 1
      Since:
      4.3.0
    • bossBar

      static @NonNull BossBar bossBar​(@NonNull Component name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay, @NonNull Set<BossBar.Flag> flags)
      Creates a new bossbar.
      Parameters:
      name - the name
      progress - the progress, between 0 and 1
      color - the color
      overlay - the overlay
      flags - the flags
      Returns:
      a bossbar
      Throws:
      IllegalArgumentException - if progress is less than 0 or greater than 1
      Since:
      4.0.0
    • name

      @NonNull Component name()
      Gets the name.
      Returns:
      the name
      Since:
      4.0.0
    • name

      default @NonNull BossBar name​(@NonNull ComponentLike name)
      Sets the name.
      Parameters:
      name - the name
      Returns:
      the bossbar
      Since:
      4.3.0
    • name

      @NonNull BossBar name​(@NonNull Component name)
      Sets the name.
      Parameters:
      name - the name
      Returns:
      the bossbar
      Since:
      4.0.0
    • progress

      float progress()
      Gets the progress.

      The progress is a value between 0 and 1.

      Returns:
      the progress
      Since:
      4.0.0
    • progress

      @NonNull BossBar progress​(float progress)
      Sets the progress.

      The progress is a value between 0 and 1.

      Parameters:
      progress - the progress
      Returns:
      the bossbar
      Throws:
      IllegalArgumentException - if progress is less than 0 or greater than 1
      Since:
      4.0.0
    • percent

      @Deprecated default float percent()
      Deprecated.
      for removal since 4.2.0, use progress()
      Gets the progress.

      The progress is a value between 0 and 1.

      Returns:
      the progress
      Since:
      4.0.0
    • percent

      @Deprecated default @NonNull BossBar percent​(float progress)
      Deprecated.
      for removal since 4.2.0, use progress(float)
      Sets the progress.

      The progress is a value between 0 and 1.

      Parameters:
      progress - the progress
      Returns:
      the bossbar
      Throws:
      IllegalArgumentException - if progress is less than 0 or greater than 1
      Since:
      4.0.0
    • color

      @NonNull BossBar.Color color()
      Gets the color.
      Returns:
      the color
      Since:
      4.0.0
    • color

      @NonNull BossBar color​(@NonNull BossBar.Color color)
      Sets the color.
      Parameters:
      color - the color
      Returns:
      the bossbar
      Since:
      4.0.0
    • overlay

      @NonNull BossBar.Overlay overlay()
      Gets the overlay.
      Returns:
      the overlay
      Since:
      4.0.0
    • overlay

      @NonNull BossBar overlay​(@NonNull BossBar.Overlay overlay)
      Sets the overlay.
      Parameters:
      overlay - the overlay
      Returns:
      the bossbar
      Since:
      4.0.0
    • flags

      @NonNull Set<BossBar.Flag> flags()
      Gets the flags.
      Returns:
      the flags
      Since:
      4.0.0
    • flags

      @NonNull BossBar flags​(@NonNull Set<BossBar.Flag> flags)
      Sets the flags.
      Parameters:
      flags - the flags
      Returns:
      the bossbar
      Since:
      4.0.0
    • hasFlag

      boolean hasFlag​(@NonNull BossBar.Flag flag)
      Checks if this bossbar has a flag.
      Parameters:
      flag - the flag
      Returns:
      true if this bossbar has the flag, false otherwise
      Since:
      4.0.0
    • addFlag

      @NonNull BossBar addFlag​(@NonNull BossBar.Flag flag)
      Adds a flag to this bossbar.
      Parameters:
      flag - the flag
      Returns:
      the bossbar
      Since:
      4.0.0
    • removeFlag

      @NonNull BossBar removeFlag​(@NonNull BossBar.Flag flag)
      Removes a flag from this bossbar.
      Parameters:
      flag - the flag
      Returns:
      the bossbar
      Since:
      4.0.0
    • addFlags

      @NonNull BossBar addFlags​(@NonNull BossBar.Flag @NonNull ... flags)
      Adds flags to this bossbar.
      Parameters:
      flags - the flags
      Returns:
      the bossbar
      Since:
      4.0.0
    • removeFlags

      @NonNull BossBar removeFlags​(@NonNull BossBar.Flag @NonNull ... flags)
      Removes flags from this bossbar.
      Parameters:
      flags - the flags
      Returns:
      the bossbar
      Since:
      4.0.0
    • addFlags

      @NonNull BossBar addFlags​(@NonNull Iterable<BossBar.Flag> flags)
      Adds flags to this bossbar.
      Parameters:
      flags - the flags
      Returns:
      the bossbar
      Since:
      4.0.0
    • removeFlags

      @NonNull BossBar removeFlags​(@NonNull Iterable<BossBar.Flag> flags)
      Removes flags from this bossbar.
      Parameters:
      flags - the flags
      Returns:
      the bossbar
      Since:
      4.0.0
    • addListener

      @NonNull BossBar addListener​(@NonNull BossBar.Listener listener)
      Adds a listener.
      Parameters:
      listener - a listener
      Returns:
      the bossbar
      Since:
      4.0.0
    • removeListener

      @NonNull BossBar removeListener​(@NonNull BossBar.Listener listener)
      Removes a listener.
      Parameters:
      listener - a listener
      Returns:
      the bossbar
      Since:
      4.0.0