BossbarLib 1.0.1

A simple, clean, and performant bossbar library.

  1. TigerHix
    A simple, clean, and performant bossbar library.

    Another bossbar library? Seriously?

    Yes, there have been a lot of libraries utilizing the bossbar to display messages. However, none of them satisfies my need. BarAPI did well in pre-1.8, but not anymore in the latest versions; and the replacements I have found would either display streams of annoying smoke particles from places to places, or random flickering and disappearances that happens a lot.

    Okay, but why choose BossbarLib?
    • It works.
    • Almost unobservable smoke particles.
    • The bossbar wouldn't disappear unless you request to do so.
    • Performant and no flickerings. Unlike some libraries, BossbarLib just wouldn't spawn a new entity every time a new message is displayed.
    • Clean, object-oriented approach that a ten-year-old could understand.
    • Can be used as a standalone plugin, or be shaded into your project.

    Is BossbarLib perfect?

    Unfortunately, not quite. Here are some worth-mentioning problems:
    • Wither shields when the health is under 50%. This is completely client-side, and there are no ways to avoid it. There are some workarounds, though: you can make a custom resource pack with entity/wither/wither.png, entity/wither/wither_armor.png, entity/wither/invulnerable.png set to a blank, transparent image, so that players wouldn't be able to see the goddamn wither even though it is rendered. The second workaround is easier: just never set the health of a bossbar under 50%. If you want to use the bossbar as a timer, make the message to indicate the time left instead.
    • Version dependent (currently, it supports Spigot 1.8.8 only). Bad news, the default implementation of BossbarLib optimizes the wither entity by extending EntityMonster, a class in NMS package - which means you have to update BossbarLib every time when there is a Minecraft version update. The good news is, unless Mojang have developed new glitches for the bossbar again, making BossbarLib up-to-date usually wouldn't take so long.

    How do I add it to my project?

    Simply add the following to your pom.xml.

    Code (Text):

    And, you are good to go.

    How do I use it?

    First, you have to decide whether you use BossbarLib as a standalone plugin, or you just go shade it into your own plugin. For the latter case, you have to add following code to your onEnable():

    Code (Text):

    To let BossbarLib holds a reference to your plugin and hence able to schedule tasks, register events, etc.

    Setting the bossbar of a player is simple:

    Code (Text):
    BossbarLib.getHandler().getBossbar(player).setMessage(ChatColor.BOLD + "I love cookies.").setPercentage(1f);

    And of course, to clear the bossbar:

    Code (Text):

    Do note that, getBossbar(Player) will instantiate a bossbar for that player if the player does not have one. For determining whether or not a player has a bossbar displayed, use:

    Code (Text):


    Get used of BarAPI.setMessage(Player, String)-alike methods?

    If you are get used to those static helper classes which are widely used in other bossbar libraries, simply add this gist to your project. Now you can do the following:

    Code (Text):
    BossbarHelper.updateMessage(Player, String);
    BossbarHelper.updatePercentage(Player, float);
    BossbarHelper.updateAll(Player, String, float);


    Source code released under GNU LGPL License. Star it if you like it.

    My other resources:
    If you have any questions, ask them in the thread - after all, posting an error log in the review section wouldn't help anyone :(
    If BossbarLib helps you, consider leaving a like. A review would be also appreciated!

Recent Reviews

  1. DeprecatedLuke
    Version: 1.0.1
    U ppl do no research. Okay so if you did more research about wither data there is a specific field which controls the wither invulnerable. Setting that value to 893 - perfect size makes wither invisible:

    I'll just give you the solution... set data value 20 to 932
    data int 14 is Invulnerable time - but for some reason it's 20 in bukkit
  2. Yazio
    Version: 1.0.1
    I saw your other lib and then i saw this and i was like "I MUST DOWNLOAD THIS TOO" .. back to topic it's amazing bruh keep up with these amazing libs!
  3. l3st4tPlugins
    Version: 1.0.0
    Finally a BossBar API that's not flickering on 1.8. Thanks!
    - Very useful!
  4. DeadlyBlaze
    Version: 1.0.0
    Thanks babe, very useful :33
  5. iSach
    Version: 1.0.0
    Thanks for making a lib about BossBar! GG! :)