diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 583b99c980..977adff6e1 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -61,6 +61,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private final Set channels = new HashSet(); private final Map hiddenPlayers = new MapMaker().softValues().makeMap(); private int hash = 0; + private boolean scaledHealth; public CraftPlayer(CraftServer server, EntityPlayer entity) { super(server, entity); @@ -997,4 +998,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.server.getScoreboardManager().setPlayerBoard(this, scoreboard); } + + public float getScaledHealth() { + return (float) (this.scaledHealth ? getHealth() / getMaxHealth() * 20.0D : getHealth()); + } + + public void setScaleHealth(boolean scale) { + this.scaledHealth = scale; + } + + public boolean isScaledHealth() { + return this.scaledHealth; + } }