This is my second resource on Spigot, and it is BossBarAPI.
BossBarAPI, is a very powerful tool for both server owners and developers to take advantage of the BossBar.
Server Owner Note:
I'm working on better support for your end of the plugin, I didn't put as much time in to the server owner mode compared to the developer mode, but you guys will get better support and more features and such soon!
Developer Note:
When I first used the new Spigot 1.9 BossBar API, I was very confused on why it wasn't showing to players, or functioning as I thought it would.
With BossBarAPI, you can condense your code from:
to
and it will automatically set the player's boss bar, and you may retrieve it by doing this:
You can remove player's bars with this:
You can also create Bar Animations, with the AnimationUtility class.
Usage:
There are also events! BarAnimationCycleEvent, for when an animation frame goes by, and PlayerSetBarEvent, for when a player gets their bar set.
NOTE: By cancelling BarAnimationCycleEvent, it is not needed to cancel PlayerSetBarEvent.
BarAnimationCycleEvent ---> PlayerSetBarEvent ---> The in-game bar.
(BarAnimationTask goes through BarAnimationCycleEvent, then sets the player's bar with the BarUtility class, and BarUtility goes through PlayerSetBarEvent.)
Should be about everything for you awesome developers! If you make anything cool with the API, shoot me a message!
You are free to use this any way you want, as long as:
- You give me credit
- You don't use this in any way that breaks Mojang's EULA and/or Terms
- You don't use this in any way that breaks SpigotMC's EULA and/or Terms
- I can update this resource at any time, and add anything to it that doesn't violate SpigotMC's plugin guidelines.
- I don't have to update this plugin or provide support
- Errors will be PM'd to me instead of left in the review section
Thanks for looking at my resource!
BossBarAPI, is a very powerful tool for both server owners and developers to take advantage of the BossBar.
Server Owner Note:
I'm working on better support for your end of the plugin, I didn't put as much time in to the server owner mode compared to the developer mode, but you guys will get better support and more features and such soon!
Developer Note:
When I first used the new Spigot 1.9 BossBar API, I was very confused on why it wasn't showing to players, or functioning as I thought it would.
With BossBarAPI, you can condense your code from:
Code (Text):
BossBar bossBar = Bukkit.createBossBar("Hello", BarColor.PINK, BarStyle.SOLID);
bossBar.addPlayer(player);
bossBar.show();
bossBar.addPlayer(player);
bossBar.show();
Code (Text):
BossBar bossBar = BarUtility.getInstance().createBossBar(player, "Hello", BarColor.PINK, BarStyle.SOLID);
Code (Text):
BarUtility.getInstance().getBossBar(player);
// Will return null if they don't have a bar.
// Will return null if they don't have a bar.
Code (Text):
BarUtility.getInstance().setBossBar(player, null);
You can also create Bar Animations, with the AnimationUtility class.
Usage:
Code (Text):
List<String> frames = new ArrayList<>();
frames.add("Frame 1");
frames.add("Frame 2");
frames.add("Frame 3");
BarAnimationTask barAnimationTask = AnimationUtility.getInstance().createAnimation(frames);
// This will set the global bar animation, because currently this plugin only supports one at a time.
frames.add("Frame 1");
frames.add("Frame 2");
frames.add("Frame 3");
BarAnimationTask barAnimationTask = AnimationUtility.getInstance().createAnimation(frames);
// This will set the global bar animation, because currently this plugin only supports one at a time.
There are also events! BarAnimationCycleEvent, for when an animation frame goes by, and PlayerSetBarEvent, for when a player gets their bar set.
NOTE: By cancelling BarAnimationCycleEvent, it is not needed to cancel PlayerSetBarEvent.
BarAnimationCycleEvent ---> PlayerSetBarEvent ---> The in-game bar.
(BarAnimationTask goes through BarAnimationCycleEvent, then sets the player's bar with the BarUtility class, and BarUtility goes through PlayerSetBarEvent.)
Should be about everything for you awesome developers! If you make anything cool with the API, shoot me a message!
You are free to use this any way you want, as long as:
- You give me credit
- You don't use this in any way that breaks Mojang's EULA and/or Terms
- You don't use this in any way that breaks SpigotMC's EULA and/or Terms
- I can update this resource at any time, and add anything to it that doesn't violate SpigotMC's plugin guidelines.
- I don't have to update this plugin or provide support
- Errors will be PM'd to me instead of left in the review section
Thanks for looking at my resource!
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.9
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
BossBarAPI is a free Minecraft Java mod. Compatible with Minecraft 1.9. Downloaded 1,024 times (via Spigot). Download it and open it directly in the game.