BarAPI
BarAPI
Server Owners
This plugin does nothing on its own. It is simply an API for other plugins to implement with.
Developers
Simply add BarAPI.jar to your project build path.
This plugin makes use of reflection and therefore "shouldn't" break on craftbukkit updates.
Limitations
The message can not be more than 64 characters. If it is more, BarAPI will automatically cut it to 64 characters to prevent the client from crashing.
This is a client limitation and cannot be changed.
Examples
BarAPI.setMessage(Player player, String message)
Set a message for the player. It will remain there until the player logs off or another plugin overrides it.
BarAPI.setMessage(Player player, String message, float percent)
Same as above except you can set the % of the health bar. 100 shows the entire health bar, 50 shows half the health bar and so on.
BarAPI.setMessage(final Player player, String message, int seconds)
Sets a timed message for the player. It will remain until the timer runs out. The health automatically reduces based on how long the timer is.
BarAPI.hasBar(Player player)
Pretty self explanatory, returns a boolean.
BarAPI.removeBar(Player player)
Also pretty self explanatory.
BarAPI.setHealth(Player player, float percent)
Allows you to modify the health of an existing bar. If the player has no bar, this does nothing.
Tutorials
Source
Maven
<repositories> <repository> <id>confuser-repo</id> <url>http://ci.frostcast.net/plugin/repository/everything</url> </repository> </repositories> <dependencies> <dependency> <groupId>me.confuser</groupId> <artifactId>BarAPI</artifactId> <version>3.0</version> </dependency> </dependencies>
Developer Builds
These builds have not been approved by BukkitDev staff, therefore, use at your own risk.
Updater
This plugin contains an auto updater which is enabled by default. If you do not wish to automatically download new updates, edit BarAPI/config.yml and set autoUpdate to false.
To Dos
- Scroll messages if string is greater than 64 characters.
Plugins Using BarAPI
Metrics
To determine popularity and usage of BarAPI, plugin installs are automatically tracked by the Metrics plugin tracking system. Your Java version, OS, player count, server country location and plugin & server versions are collected. This is used to determine what environments are using the plugin to ensure full compatibility. This collection is anonymous. If you don't want this tracking, edit plugins/PluginMetrics/config.yml and set opt-out to true.
I got this error on last spigot patch, how I can fix?
java.lang.NoSuchMethodException: net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport.<init>(int, int, int, int, byte, byte)
@Mineraftair
If you are using a spigot build then use the latest dev build of BarAPI and edit the BarAPI config like this:
Hi,
I´m using your API for my plugin, and I like it! But, can you please make your Updater stop Spamming Errors in my log? I know that Bukkitdev is down because of an DMCA. So please correct that! Thanks!
Yours Minecraftair
@confuserr perhaps this may be of use... I hear a lot of people say it crashes their servers I have yet to try it https://github.com/mgone2010/BossbarAPI EDIT: Ok although it may help you it only takes 2 seconds to see how unstable the plugin is
Bars not shown to players. My code:
Humm well could you at least post the version on Jenkins
@Difd9
The wither has smoke and shield effects which I've not been able to completely disable at the moment.
@confuserr
Could you perhaps spawn a invisible wither with no AI at the player to prevent the issue?
@Difd9
This is not a 'flaw' of my plugin, it's a bug within the minecraft 1.8 client.
@confuserr underground the bar doesn't show up for 1.8 clients... this is a flaw of the API not any addons @JonasFranzDEV if you want you could look into writing a plugin for that
I found the author has 1.8 builds that fully support 1.8: http://ci.frostcast.net/job/BarAPI/
@Difd9
I updated it! Please ignore the exceptions they only come if you use 1.7.x but it works.
@JonasFranzDEV I cant find the version... if its the
Name Description Size MD5 BarAPI.zip Look on Github for the newest ... 60.8 KiB 187c1cf34bad...
thing it doesn't work and the console spam is just the same as @confuserr's version
Hey,
I created a BarAPI-Version with 1.8 Support.
IMPORTANT This version only supports Boss-Bar for 1.7.X. At 1.8 it uses the Bar above the ActionBar.
GitHub: https://github.com/JonasFranzDEV/BarAPI-ActionBar-Editon
Download: http://jfdev.de/barapi/
I hope that I can help you.
@confuserr I hope that there is no problem with the license.
NEW Download Link: http://jfdev.de/barapi/
Sorry for my bad english ;)
@confuserr
Maybe you can add an option to the API so you can decide wether to use the dragon or an invisible wither. For example:
BarAPI.setMessage(Player player, String message, float percent, boolean wither)
I don't need the bar to go below half health and maybe some other too ,so it would be a good addition in my opinion
@Bars96
it must be from 0 -> 100
Percent must be like 0.5F or like 50.0F for 50%?
Aaaahhh damn. Just both the crappy illegal version on spigot and didnt know it was for free on bukkit...
@Bron4
So instead of perhaps donating to this original project, you'd rather pay for an illegal copy which has since been removed, then have the audacity to come here and complain that the work that I and others have been doing for free isn't good enough?
That "paid" version used a wither, which has a shield affect below 50% health as well as smoke particles, far more annoying than seeing an ender dragon in the distance. That developer is more than welcome to make a pull request. I haven't merged in any that use the wither as none of them have been able to solve the shield affect thus far.
@confuser
I do understand your issue with the "paid" version that was being sold elsewhere. But perhaps, you should work with that developer.
Because ill be honest, the $ i paid for his version was the best $5 I spent in the last month.
I'm not sure how he got it to work. but it works as good as before 1.8.
And I don't have people constantly complaining about visible Ender dragons , which admittedly is highly annoying.
I am still not sure what is causing the NPE I reported a few days ago, but I have a feeling its related to the dragon not being visible when my plugin attempts to BarAPI.setMessage(player, message, this.shrinePower); I find it happens more towards the end of our mini-game when the dragon is behind the bedrock walls that surround the map, the players bar will be gone and my plugin will attempt to setMessage(). I could be wrong but I think if I do a hasBar() check this will only check if they are within an array not if they can see the dragon in their FOV.
Thanks again for this awesome plugin, I am using the spigot-20141001a.bps and BarAPI Dev build #27.