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 think the version of the Maven dependency needs to be updated. Seems like 3.0 no longer exists. All I see is 3.4-SNAPSHOT now.
https://www.spigotmc.org/resources/mybar.15729/
Thank for best source code
Hey,
I have a little problem with BarAPI ;-(
And this repeats every time... It appears when a player joins the server.
EDIT:
THE BUG HAS BEEN FIXED IN VERSION 'Minecraft development snapshot 15w31a' !
(not written in the update logs but written on the bug link)
IN THE NEXT VERSION OF MINECRAFT (the current one is 1.8.8) THE BUG SHOULD BE CORRECTED !
End of Edit.
Some links :
Hello there everyone. I think i just found a fix for the enderdragon bug! I thought, hmmm what else makes a boss bar, and ofc the WitherBoss does just that! And you can make him silenced, and noai, and invisble! The only problem with this is that u can still see some particles if ur really close too him
Edit: Found a problem with this... When the bar i low, i forgot that he gets this sort of shield? Idk if u can fix that in bukkit somehow?
@stefvanschie
Ok then. ;/
But u sure u cant make it invis?
@Froosty11
As Dinnerbone said, the bug is gonna be fixed in 1.9, I don't know if you can make it invisible.
@confuser
So its not fixable? Can't u make it invisble or something?
Could you add to the plugin list BuildingGame? Would be appreciated!
I'll say this once more...
Due to a client side bug with 1.8, the bar is only visible to a player if they are looking at the enderdragon. This means players will be able to see an enderdragon in the distance
Can you do something with the enderdragon bug? It appears every time I use the bar.
@Adrimuvi
I swear. It took me forever to figure out what was causing that bug. I finally figured it out.
you can fix the bug to enderdragon? It is annoying and ugly
I can´t use Multiverse, if i used your API.
Please help me. There ist no error in the console
@ComandanteEver1
Not that you are using a 1.7 server with a 1.8 barapi... ;)
This plugin does not work ..
[15:39:34] [Server thread/WARN]: java.lang.NoSuchMethodException: net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport.<init>(int, int, int, int, byte, byte, boolean, boolean)
[15:39:34] [Server thread/WARN]: at java.lang.Class.getConstructor0(Unknown Source)
[15:39:34] [Server thread/WARN]: at java.lang.Class.getConstructor(Unknown Source)
[15:39:34] [Server thread/WARN]: at me.confuser.barapi.nms.v1_8Fake.getTeleportPacket(v1_8Fake.java:138)
[15:39:34] [Server thread/WARN]: at me.confuser.barapi.BarAPI.sendDragon(BarAPI.java:439)
[15:39:34] [Server thread/WARN]: at me.confuser.barapi.BarAPI.setMessage(BarAPI.java:207)
[15:39:34] [Server thread/WARN]: at hub.Hub$1.run(Hub.java:197)
[15:39:34] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71)
[15:39:34] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[15:39:34] [Server thread/WARN]: at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:641)
[15:39:34] [Server thread/WARN]: at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289)
[15:39:34] [Server thread/WARN]: at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
[15:39:34] [Server thread/WARN]: at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
[15:39:34] [Server thread/WARN]: at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
Could you add mcMMOExtras to the plugin list?
Update to 1.8.6 please !
cant work with 1.8.3,i have tested all the plugins use barapi,they cant work.
@SwaG1KinG
OMG, again ?
The plugin is having issues with 1.8...
The plugin may print error codes... And may not works...
please read the "known issues":
You may follow the error here:
https://bugs.mojang.com/browse/MC-68062