aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java
index d635f065..2501fa03 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWarnLowHealth.java
@@ -74,9 +74,9 @@ public class FeatureWarnLowHealth extends TextHUDFeature {
ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(sc.getPlayerName());
String line = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()).trim();
String stripped = TextUtils.keepScoreboardCharacters(TextUtils.stripColor(line));
- if (line.endsWith("❤")) {
- String name = stripped.split(" ")[1];
- int health = Integer.parseInt(stripped.split(" ")[2]);
+ if (line.contains("[") && line.endsWith("❤")) {
+ String name = stripped.split(" ")[stripped.split(" ").length - 2];
+ int health = Integer.parseInt(stripped.split(" ")[stripped.split(" ").length - 1]);
if (health < lowestHealth) {
lowestHealth = health;
lowestHealthName = name;