diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 3574b4768..008e2926e 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -427,6 +427,10 @@ public class PlayerListener implements Listener { ItemStack heldItem = player.getItemInHand(); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + if (mcMMOPlayer == null) { + return; + } + switch (event.getAction()) { case RIGHT_CLICK_BLOCK: Block block = event.getClickedBlock(); diff --git a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java index 6bf871710..fba006f80 100644 --- a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java @@ -46,7 +46,10 @@ public final class MobHealthbarUtils { PlayerProfile profile = UserManager.getPlayer(player).getProfile(); - if (profile.getMobHealthbarType() == MobHealthbarType.DISABLED) { + if (profile == null) { + return; + } + else if (profile.getMobHealthbarType() == MobHealthbarType.DISABLED) { return; }