PlayerBar
Owners
This plugin is mainly designed as an API but if you use it standalone on your server it will act as a new health system!
Plugin Developers
To use the API just drop the plugin into you're java build path.
API
Functions
PlayerBar.getHealth(player) Will return the health of a specific player.
PlayerBar.getMaxHealth(player) Will return a player max health.
PlayerBar.getMessage(player) Will return the message displayed on a player's bar.
PlayerBar.hasHealth(player) Will return if the player has a bar or not.
PlayerBar.setHealth(player, health, livingEntity, killAble) Will set a player's health, if the player wasn't hit by anything set the livingEntity as null and if the player wont die from the event set the killAble as false.
PlayerBar.updateBar(player, livingEntity, killAble) Will update the bar for a player, leave the livingEnitty as null if the player wasn't hit by something and set killAble as false if the player can't die from the specific event.
PlayerBar.setMainDisplay(player) Will display the bar of a specific player on everyone's screen.
Metadata You can get a players "playerBarHealth" metadata to get his health, if you don't want to use the plugin API it'self!
If you change the damage of the EntityDamageByEntityEvent the damage taken should decrease the player health.
Custom Event
event.getAttacker() Returns the entity which attacked the player, if none will return null.
event.getHealth() Returns the player health after being changed.
event.getMaxHealth() Returns the player max health.
event.getPercentage() Returns player's ..% health.
event.getPlayer() Returns the player triggering the event.
Use "HealthUpdateEvent" to trigger the event!
Configs
Increase Health After Time: true - Set to false if you don't want players to regen hp.
Increase If Player Has Hunger: true - Set to false if you want players always to regen hp.
Health Type: bar - Sets the type of bar which will be used ( bar, normal, text ) [ Keep in mind to restart the server if you change this and you use v0.4! ]
Update Time: 5000 - Set the amount of times for the players to gain hp ( milliseconds ).
Health Increased After Time: 1 - Set the health regenerated every update.
Message: 'You have %health% health and level %level%' - Set's the message on the base ( tags supported: %name%, %level%, %health% , %maxHealth%, %expToLevel%, %food%, %flySpeed%, %speed%).
Default Max Health: 20 - Set's the default max health, which will be set when a player joins for the first time.
Plugins using PlayerBar
Send me a private message with you're plugin if you are using PlayerBar.
What this actually does
If you use this plugin all by it'self it will change the minecraft old healthbar to a new one way more configureable!
Metrics
This plugin utilises Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
- A unique identifier.
- The server's version of Java.
- Whether the server is in offline or online mode.
- The plugin's version.
- The server's version.
- The OS version/name and architecture.
- The core count for the CPU.
- The number of players online.
- The Metrics version.
- Opting out of this service can be done by editing plugins/Plugin Metrics/config.yml and changing opt-out to true.
Reminder
This plugins changes the way minecraft health works, keep that in mind!
@99razvan99
i had a custom plugin using bar api to display players hp as a bar, and works perfectly fine with item lore stats, maybe its not his fault?
@LordVerlion
Yeah, so it's his fault, not mine.
@99razvan99
ItemLoreStat forcibly changes the max-health of a player to whatever is set in default. The only way to disable this is to disable all of ILS's health features (in it's config). It's a great plugin, but this one major flaw is why I dropped it myself.
@leokiller97
My plugin is made in a way that it should be compatible with mostly any other plugin wich changes the damage of a item.
Thanks! Anyway, I don't think that's a bug... Maybe some kind of incompatiblity.
@leokiller97
Or, cause you've found the bug you should post a ticket about it on itemLoreStats.
@leokiller97
I've already made a plugin mostly better than itemLoreStats which I am not going to publish, at least not soon which works fine with using PlayerBar API, anyway I think it's itemLoreStats fault that it doesn't work and there's nothing I can do cause that plugin doesn't come with a API :(
I might try to talk with the creator of the plugin and see what I can do :D
If you could add the option to use this with ItemLoreStats' health feature, it'd be one of the best plugins ever (already it is, but with this feature it would be the BEST one)
Thank you :3
I'm going to release another update tommorow!
@leokiller97
What doesn't work?
Hey! It works now, forgot dat ''. Anyway, I see this doesn't work with ItemLoreStats.
@leokiller97
Well, I've tried the exact message you've said and it worked fine, make sure you don't have another plugin which is trying to use the dragon bar and btw, %maxhealth% is case-sensitive and it should be %maxHealth%.
Tried to use: %health%/%maxhealth% HP: %health% | Level: %level% And %health% HP - Level %level%
None works. The bar will just disappear when I /reload.
@leokiller97
It should work, what message did you used?
If I modify the message, it doesn't work and the plugin doesn't work anymore.
@Newiezz
I will see if I can fix the sound thing and I will mostly likely add a thing to be able to show to the health on the old health bar too!
Have been testing your plugin, just awesome, I have some sugestions though. 1. When I get damaged I do not get that familiar damage sound and kind of "tick", it is not taking heraths aswell, I think showing your health as a percentage on the hearth bar will be nice.
Just as a heads up I will be posting a plugin to be able to see a player's head under they're name today or tommorow. I will release a new version with some bug fixes too, tommorow.
@ThisUsernameIsMine
Thanks, I might, no promise add in the future support to change the hunger bar to the new bar and, no you can not disable the health options atm, and no you can no hide the default health bar you can only change it to have like 1 heart which looks really buggy but you can not do anything to the food bar.
I want to use this as visual replacement for the action bar health/foodbar, but don't want to use the health options. Can i disable them somehow?
(also is it possible to hide the default health-/foodbar, seeing them both is a bit funny/awkward)
Nice plugin btw ;-)