〽️xBossBar API

πŸ’» XBossBar API

The XBossBarAPI provides static methods to interact programmatically with xBossBar. You can create, manage, and delete bossbars, add/remove players, and customize colors, styles, and titles directly from your code without instantiating the API.


πŸ›  Installation

Add the repository and dependency for xBossBar.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.xDrygo</groupId>
    <artifactId>xBossBar</artifactId>
    <version>1.0.1</version>
    <scope>provided</scope>
</dependency>

After adding the dependency, add xBossBar as a dependency in your plugin.

name: MyPlugin
main: com.example.MyPlugin.MyPlugin
version: 1.0
depend:
  - xBossBar

πŸ“‹ XBossBarAPI Methods

Click to expand
  • void createBossBar(String id, String title, BarColor color, BarStyle style, boolean perPlayer) - Creates a new bossbar.

  • void removeBossBar(String id) - Removes a specific bossbar.

  • void clearAllBossBars() - Removes all bossbars.

  • void addPlayerToBossBar(String id, Player player) - Shows a bossbar to a player.

  • void removePlayerFromBossBar(String id, Player player) - Removes a bossbar from a player.

  • void setTitle(String id, String title) - Sets the bossbar title.

  • void setProgress(String id, double progress) - Sets the bossbar progress (0.0–1.0).

  • void setStyle(String id, BarStyle style) - Sets the bossbar style.

  • void setColor(String id, BarColor color) - Sets the bossbar color.

  • BossBar getBossBar(String id) - Returns the Bukkit BossBar object.

  • BossBarModel getBossBarModel(String id) - Returns the custom BossBarModel object.

  • Set<String> getBossBarNames() - Returns all existing bossbar IDs.


πŸ’‘ Notes

  • All API methods are static, so you do not need to instantiate XBossBarAPI.

  • BossBar management includes creation, deletion, player management, and customization.

  • Events allow you to react to bossbar changes in real time.


πŸ”— References

Last updated