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.
@Gyziie
Use a developer build, and ensure useSpigotHack is set to true, and the autoUpdate is set to false.
@Gyziie
I believe 1.8 broke it if you are using that. Aside from that this plugin does not do anything on it's own. You need to find plugins that utilize this plugin to actually see things happen.
Hi i really like this plugin - i just can't seem to make it work at all :/
@Minerlevel
When a wither's health goes below 50% it shows a shield affect which is far more annoying than an enderdragon.
I'll take note of the version check so that the old behaviour for the dragon can remain for 1.7.10 clients,
@confuserr
Just a suggestion: In 1.8 the boss has to be in the FOV wich can be distracting for some. You cant vanish an EnderDragon but i tested
/summon WitherBoss ~ ~ ~ {ActiveEffects:[{Id:14,Amplifier:1,Duration:999999}]}
and i got an invisible Wither which wouldn't be distracting
Furthermore you can check if the Player version is 1.8 with this line
so it would be possible to spawn the Enderdragon below the Players that are using 1.7.x and for the Players with 1.8 spawn an invisible Wither in the FOV
Whilst I am more than happy for people to fork and pretty much do what they like with this plugin (within reason), please make note of the licence terms, specifically that the licence quite explicitly states non-commercial. This means you cannot use it for monetary compensation.
This plugin is not just my work, but has multiple contributions from the community.
Attempting to sell other peoples work who have made it available for free to everyone, is disgusting.
If anyone sees anywhere attempting to sell BarAPI, as it currently is, or a even derivation, let me know, I'll gladly send a take down request, such as I did earlier today on the spigot resource section.
Not only is it an annoyance to see such actions, but it also puts off others, including myself, to make such works public in the first place.
/rant over
I use the Spigot 1.8 protocol hack, and it works with the simple broadcast plugin, but I get an error,
Is it possible to hide this error? http://pastebin.com/kwkFBxty
@confuser
Thanks for the update, I will try extending the view distance see if I can hide it a little, thanks for explaining.
I am using the September 27th patch (spigot-20140927a.bps) but I will try it with the October 1st patch now.
EDIT: Tested with patch spigot-20141001a.bps and the NPE is still present, not common or causing a problem as far as I can tell.
Also, is it possible to detect the client version and only use the 1.8 dragon in view method for 1.8 clients? Or perhaps a Wither could be less distracting.
@LihPeu
Invisible dragons aren't possible I'm afraid.
A simple test:
/summon EnderDragon 0 1 0 {ActiveEffects:[{Id:14,Amplifier:1,Duration:999999}]}
results in the invisibility effect not being applied and the dragon still being visible.
Before 1.8, the dragon didn't need to be in view and was placed far below/away from the player. The distance is based on the view-distance, so that the dragon is within the furthest loaded chunk as possible so the bar remains.
I'll take a look at your NPE error. Have you applied all the current patches to Spigot?
With 1.8 and the spigot hack enabled, is it possible to make the dragon invisible, I understand it has to be within FOV of the player but it can be distracting, is its distance set by the server "view-distance=6"?
Also I got this error Pastebin when using git-Spigot-1.7.9-R0.2-205-g48578ee (MC: 1.7.10)
@confuser
How?
@thexenon05
useSpigotHack should be true
@DanSpedey
Possibly, depends what we'll use over at Frostcast.
I'm getting this error: http://pastebin.com/rjq5yzS0 My config: autoUpdate>False, testMode>False, useSpigotHack>False.
I'm using Spigot Patched 27. Please help me, I really need this plugin working... :C
Repo with proper 1.8 support (wither for 1.8, dragon for 1.7, continously teleported wither): https://github.com/confuser/BarAPI/issues/37
Will the plugin be ported to Sponge?
The builds page seems to be down. Any update on when it will be back up?
@confuser
And how can I donwload a specialiced build?
@iaXedu
If you're on #1649 of spigot, use build 26.
If you are running spigot #1649 with the patches, use builds 27 and up.
@Jalau
Some servers, like the Hypixel Network, send wither entity packets to the player with the specified name (boss bar message) and teleports it to the player's line of sight, and stays the same position away from the player when they move. I would also like to mention that its not directly in the line of sight, it has an offset, but still works perfectly, so it can be a less of a distraction. This seems like a horrible idea, since player's can see the wither, but in 1.8 I am pretty sure u can only see bossbars when they are in line of sight :( so sad.
@confuser
thanks, my mistake. despite all that error text pointing at BarAPI it was BossBarMessage creating the error (when the /bm command is autoran at player join/death). without that plugin loaded there are no errors.