LivingEntity#setKiller

== AT ==
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
This commit is contained in:
BillyGalbreath 2017-07-31 01:49:48 -05:00
parent 0dcb203960
commit c2f10d08a9

View File

@ -417,6 +417,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity();
}
// Paper start
@Override
public void setKiller(Player killer) {
net.minecraft.server.level.ServerPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
getHandle().lastHurtByPlayer = entityPlayer;
getHandle().lastHurtByMob = entityPlayer;
getHandle().lastHurtByPlayerTime = entityPlayer == null ? 0 : 100; // 100 value taken from EntityLiving#damageEntity
}
// Paper end
@Override
public boolean addPotionEffect(PotionEffect effect) {
return this.addPotionEffect(effect, false);