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.
@gpotter2
I said I would pull and test it, I haven't had time to do that yet. Please be patient.
@Icy_D_LuX
Caused by pvprun not BarAPI.
@confuser
Huh... you said you were going to add my pull requests... ?Thanks !
@confuser
Don't works for me, causing errors on listeners...it's everything ok with this version? Or im just stupid and can't build this well. May you give me exported .jar file on PM, please?
Found out Mineplex is using a very weird way to handle using the wither. Since you will always be able to see the particles in the distance even when the wither has more then 150 health!
hiya just written my first plugin and linked it with yours :) http://dev.bukkit.org/bukkit-plugins/byte-thirst/
org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:305) [JMC.jar:git-Spigot-e497721-a1ce164] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [JMC.jar:git-Spigot-e497721-a1ce164] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [JMC.jar:git-Spigot-e497721-a1ce164] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:255) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.PacketPlayInFlying.a(SourceFile:126) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.PacketPlayInPosition.a(SourceFile:57) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [JMC.jar:git-Spigot-e497721-a1ce164] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_25] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25] at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:683) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:623) [JMC.jar:git-Spigot-e497721-a1ce164] at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:526) [JMC.jar:git-Spigot-e497721-a1ce164] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25] Caused by: java.lang.NullPointerException at fr.cabricraft.pvprun.economy.EconomyManager.<init>(EconomyManager.java:13) [?:?] at fr.cabricraft.pvprun.arenas.Arena.stopthegame(Arena.java:516) [?:?] at fr.cabricraft.pvprun.arenas.Arena.die(Arena.java:439) [?:?] at fr.cabricraft.pvprun.arenas.Arena.onPlayerDie(Arena.java:1105) [?:?] at sun.reflect.GeneratedMethodAccessor585.invoke(Unknown Source) [?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_25] at java.lang.reflect.Method.invoke(Method.java:483) [?:1.8.0_25] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) [JMC.jar:git-Spigot-e497721-a1ce164] ... 14 more [11:55:56] [Thread-65/ERROR]: Crash caused by BarAPI ! Please remove it or update it !
@confuser
Well I am back from the dead xD It is awesome that you fixed the Invul. Did you find how you could control the health along with having no Invul. Also the smoke is added to in the e method in the EntityWither class.Line 147 in my decompiler:
Will be fixed in 1.9(far-future). At least it is being fixed.
A 1.8 build using a wither does exist, however it still has smoke particles
https://github.com/confuser/BarAPI/tree/feature/wither-1.8-spigot
As a reminder:
Thanks
It gives a lot of errors... That's all I'm saying... ALOTOFERRORS!
In this plugin, plz update it so when ever a player looks around, the wither/dragon will get teleported in front of their faces (but invisible) so the Bar will not disappear for the 1.8 clients like what the BossBarAPI plugin does
@confuser
Client view-distance is sent to the server, so server knows it and can adjust the distance.
How do i make it so it uses an invisible wither instead of the dragon. The dragon is way 2 much in your face.
@Shevchikden
Remember that clients can control their own view distance, therefore if they have it set to a low value, and the entity is far away, they won't see it, and therefore won't be shown the boss bar.
@confuser Well, i tihnk smoke particles at a big distance won't distract players so much.
It looks like the smoke particles are client side. Essentially, control over the boss bar either via a dragon or wither both have problems.
Dragon can't be invisible and therefore can be seen in the distance. Wither shows smoke particles on the client, only way for those to not show is if the client goes into their Video Settings and sets particles to minimal.
I'm afraid this plugin all depends on whether Mojang will fix the ender dragon bar not showing if you're not looking at it within the client. I very much doubt the wither will be changed to allow for no particles to be emitted.
https://bugs.mojang.com/browse/MC-68062
@xtomyserrax
I have answered you.
@gpotter2
Hey, please read PM's. I have a question of my code. Because the barapi doesnt disappear.
@gpotter2
Hey, thank you so much!
But how can i define what " on " means?
Sorry im learning to programm