mirror of
https://github.com/zeshan321/ActionHealth.git
synced 2024-11-14 06:45:11 +01:00
Added 'percenthealth' placeholder
This commit is contained in:
parent
f4671413b3
commit
e54cc146f0
@ -5,6 +5,7 @@
|
||||
# {usestyle} will use the defined chars.
|
||||
# {displayname} will use player/mob custom name.
|
||||
# {opponentlastdamage} the amount of damage the enemy last received.
|
||||
# {percenthealth} displays the percentage of health left.
|
||||
# Has support for PlaceholderAPI and MVdWPlaceholderAPI.
|
||||
Health Message: '&7&l{name}: {usestyle}'
|
||||
|
||||
|
@ -122,6 +122,7 @@ public class HealthUtil {
|
||||
output = output.replace("{name}", name);
|
||||
output = output.replace("{health}", String.valueOf((int) health));
|
||||
output = output.replace("{maxhealth}", String.valueOf((int) maxHealth));
|
||||
output = output.replace("{percenthealth}", String.valueOf((int) ((health / maxHealth) * 100.0)));
|
||||
output = output.replace("{opponentlastdamage}", String.valueOf((int) entity.getLastDamage()));
|
||||
|
||||
if (output.contains("{usestyle}")) {
|
||||
|
Loading…
Reference in New Issue
Block a user