Personal Health Bar
Personal Health Bar
Info
Personal Health Bar is simply plugin to show Player Health. This plugin show your health in real time.
Plugin is simple and easy to make but I made him for me and paste it here because I want save your time.
Reqiered BarAPI!!!
Showing
Health: Actual Health / MaxHealth
(//////=========) <==== Bar shows Actual Health
Milestones
100 downloads!
250 downloads!
500 downloads!
1000 downloads!
More?
Source
Source is small than I paste it here
package main.healthbarapi.java; import java.util.ArrayList; import java.util.logging.Logger; import me.confuser.barapi.BarAPI; import org.bukkit.ChatColor; import org.bukkit.entity.Damageable; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; public class HealthBar extends JavaPlugin { ArrayList<String> first = new ArrayList<String>(); public static HealthBar plugin; public final Logger logger = Logger.getLogger("Minecraft"); @EventHandler public void onPlayerJoin(PlayerInteractEvent event){ final Player player = event.getPlayer(); int Health = (int) ((Damageable) event).getHealth(); int MaxHealth = (int) ((Damageable) event).getMaxHealth(); if(!first.contains(player.getName())){ BarAPI.hasBar(player); BarAPI.getHealth(player); BarAPI.setMessage(player,ChatColor.GREEN + "Health:" + ChatColor.RED + Health + ChatColor.GREEN + "/" + ChatColor.RED + MaxHealth, 1); } } public void onDisable() { logger.info("[HealthBar] disabled!"); logger.info("plugin by MaHl111"); } public void onEnable() { logger.info("[HealthBar] enabled!"); logger.info("plugin by MaHl111"); } }
It probably works with every Minecraft version, but on version 1.7.2 it totally work!
Im open with changes in my code but don't forgive, base code is mine, respect it ;)
To Do
- Colored Text
- Health values is little bugged sometimes
- Colored Health values based on percent of Health (25%+ Red/ 50%+ Yellow/75%+ Green)
- If it doesn't work with other version, fix it
- Hide classic Minecraft Health Bar
- and so...
When you want to do this changes, feel free, but paste download link in your comment for my reupload :)
Thank you! :)
Sorry for my bad English, it isn't my country language.
-
View User Profile
-
Send Message
Posted Sep 19, 2015@8lacksouls
Yeah... know... I'm fixing it but from some reason any of my version for 1.8.8 doesn't work... I try make around 38 versions but any of it doesn't work :/ Sorry for that :/
-
View User Profile
-
Send Message
Posted Sep 8, 2015@MaHl111
still don't work for me
-
View User Profile
-
Send Message
Posted Sep 8, 2015@Mudentmouse
@linghun91
@8lacksouls
Well... I make 1.8.8 but from some reason it shouldn't work... It's probably because BarAPI is only 1.8 and my version is not correct or I don't know... Or because I'm idiot and don't add BarAPI "show" permission in config :D. Download it, test it and say me...
-
View User Profile
-
Send Message
Posted Sep 7, 2015Can you support 1.8.8
-
View User Profile
-
Send Message
Posted Sep 7, 2015dose not work for me spigot 1.8.8
yeah still don't work for me
-
View User Profile
-
Send Message
Posted Sep 7, 2015I could update it to 1.8.8 if id doesn't work....
-
View User Profile
-
Send Message
Posted Aug 23, 2015Nice job! Keep up the good work!
-
View User Profile
-
Send Message
Posted Aug 12, 2015@TheIntelloBox
Yeah, sorry but that is thing what I cannot repair :/
Maybe other version of BarAPI with support for 1.8.7 if it exist?
-
View User Profile
-
Send Message
Posted Aug 10, 2015@TheIntelloBox
BarAPI works on 1.8.8...
-
View User Profile
-
Send Message
Posted Aug 10, 2015Bar api doesn't work on 1.8.7... so can't use your plugin