diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 4aff23dd5..cbf8a9b0a 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -66,11 +66,11 @@ public class PlayerListener implements Listener { String deathMessage = event.getDeathMessage(); PlayerProfile profile = UserManager.getPlayer(event.getEntity()).getProfile(); - if (profile.getMobHealthbarType() == MobHealthbarType.HEARTS && deathMessage.contains("❤❤")) { - deathMessage.replaceFirst("❤+", ChatColor.RESET + "a mob"); + if (profile.getMobHealthbarType() == MobHealthbarType.HEARTS && deathMessage.contains("❤")) { + deathMessage.replaceFirst("(?:\\u00A7(?:[1-9a-fklmnor]){1}(?:❤{1,10})){1,2}", ChatColor.RESET + "a mob"); } - else if (profile.getMobHealthbarType() == MobHealthbarType.BAR && deathMessage.contains("■■■■■■■■■■")) { - deathMessage.replace("■■■■■■■■■■", ChatColor.RESET + "a mob"); + else if (profile.getMobHealthbarType() == MobHealthbarType.BAR && deathMessage.contains("■")) { + deathMessage.replaceFirst("(?:\\u00A7(?:[1-9a-fklmnor]){1}(?:■{1,10})){1,2}", ChatColor.RESET + "a mob"); } event.setDeathMessage(deathMessage);