mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
Don't set health directly, will interfere with scoreboard system.
This commit is contained in:
parent
7466321212
commit
5903b9f5ca
@ -642,12 +642,12 @@ public abstract class EntityLiving extends Entity {
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.health += event.getAmount();
|
||||
this.setHealth(this.getHealth() + event.getAmount());
|
||||
}
|
||||
|
||||
// this.getMaxHealth() -> this.maxHealth
|
||||
if (this.health > this.maxHealth) {
|
||||
this.health = this.maxHealth;
|
||||
this.setHealth(this.maxHealth);
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user