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.
@confuser
The problem with the dragin being at the furthest view distance is it has to wait until the chunk containing it is loaded. My server has a view distance of 32, and it's a really long wait before the chunks there are loaded. Also if you set your client to a view distance of 31, the bar will never appear (unless you look up or down). Maybe limit it to 16 chunks away ?
@comniemeer
What plugins are you using that use BarAPI on the server?
@WeBBHosts
It could be made closer, however, it'll mean the dragon will be quite close and perhaps be in the way of whatever they're looking at. Unfortunately, either Mojang fix the original problem (which isn't easy due to 1.8 optimisations they did) that forces the dragon to be visible in order to see the bar, or use Withers instead if a way to disable the shield effect is found.
Hey, I get sometimes this error in the console:
http://pastebin.com/WGaakwrR
Why does this happen and can you fix that?
Edit: Oh and this error occurs also sometimes: http://pastebin.com/HBc22K1T
@confuser
Huge thanks to you ! Keep amazing us !
By the way, it doesn't appear on people's screens if they have their view distance turned under the servers' one. Any way to have the dragon closer than server's view distance ? Or maybe to force the loading of the chunk where the dragon is at ?
v3.3 released, supports Spigot 1.8, not just the protocol hack.
@confuser
I am aware of the boss shield issue with withers. The api works fine for showing messages, but you are right. I am still playing around with it, but as it is a client side effect it might be close to impossible to remove it. I have been talking with md_5, and the spigot team but they have more pressing issues they have higher on their list of stuff to fix, but they DO intend on fixing issues with ender dragon.
I am trying to use this in 1.8 with my plugin, but I am getting this error:
I found a craftbukkit version for 1.8! Maybe it helps you! http://spigotmc.info/
(I use it too, it works perfect ;-))
PM me for working copy for 1.8 Official and Protocol Hack spigot version. I've updated the plugin for my server. Also, there's an option in Config if you're using latest version, it says "useSpigotHack" you need to put "true" in there.
i can see enderdragon if use this plugin on latest spigot patch with/without carbon, and i use the latest dev build (#29)
@ferrago
Have you solved the shield/particle effects withers show when going below 50% health? If so, I'd be happy to accept a PR for it. If not, I'd recommend testing at below 50% health, you'll see it is far more annoying than simply seeing an enderdragon in the distance.
@ferrago
So when/how do we stop getting the annoying console spam errors?
This is extremely frustrating...and I have no idea how to 'shut it up'. I contacted my server host, and they said simply removing the plugin fixes it....I just tilted my head and thought, "but I want the plugin...what do you say to that?" They didn't know, and just removed it again.
So where does this leave us server owners using the Spigot 1.8 (1.7 hack, no 1.8 features)???
@NubeBuster
His plugin was updated for spigot 1.7.10 (fake 1.8 protocol). Therefor the 1_8_R1 stuff isn't in his plugin. That is why you are getting errors. Wait for him to update it.
@confuser
I was able to negate the issue of the EnderDragon being in the distance by modifying your code to use fake WIthers instead. The setInvisible() doesn't effect the EnderDragon, but it does effect the Wither. Only problem I am having is the bar fill percent and the name isn't updating. I am looking through the NMS to figure out why. But this was all confirmed on most recent version of spigot.
EDIT: Fixed the percentage from being wrong by updating max total health to 300. Just need to figure out why name isn't updating. EDIT2: Fixed the message display, by removing the current bar if set, when setting message.
If you would be so kind I am sure players would love if you used the invisible wither instead so player's couldn't see it.
If you would like me to send you a pull request for my changes for you to review I can.
When a player switches world this spams in the logs. http://pastebin.com/e7eF0zfb I am using the latest version and git-Spigot-3726e0d
Can you update your plugin to 1.8 please?
Hey, So I need help on BarAPI because every time I start my server and a player joins, the BarAPI starts to spam up the console, and it's pretty annoying. now, whenever a player is using commands, I can't see who or what they are doing because BarAPI is spamming the consle. Besides, it usually causes my server to crash and like millions of WARNS or ERRORS start to pop up every second! Everything is fine, it's working fine, but the console is messed up A LOT!
Bossmessage has suddenly stopped working now on Spigot... When you face the ground the boss bar disappears and broadcast/schedule task doesn't work. Please fix if you can. Thnaks very much!! :D
http://pastebin.com/nNtQfYt2 i keep getting this error on server shutdown
On (spigot 1649).
Use BarAPI v3.2 and Mythicmobs v1.1.4, call Bossbar will be forced to close client.
Use BarAPI v3.2 and Itemlorestats v4.67 call Bossbar, Bossbar may be disappear and console have so many warning.
Forgive my poor English.