Fixed crash on death for servers

Fixed an issue where the client would crash when you died by the Sacrificial Knife when on a server.
This commit is contained in:
WayofTime 2020-10-26 16:08:04 -04:00
parent ec1b0644cb
commit 152525bbe3
6 changed files with 8 additions and 6 deletions

View file

@ -102,7 +102,7 @@ public class ItemSacrificialDagger extends Item
player.hurtResistantTime = 0;
player.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 0.001F);
player.setHealth(Math.max(player.getHealth() - 1.998F, 0.0001f));
if (player.getHealth() <= 0.001f)
if (player.getHealth() <= 0.001f && !world.isRemote)
{
player.onDeath(DamageSourceBloodMagic.INSTANCE);
player.setHealth(0);