diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-11-25 22:55:50 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-11-25 22:55:50 -0500 |
commit | 8b78e680240a20d1b44c03f6bbcbb42b36a02827 (patch) | |
tree | 95b4ed1261812327d45b67788fbb246eeb3baae5 /src/main/java/me/Danker/TheMod.java | |
parent | 4d0fb63db61deba0e0f1ce569c91e8b876abfa64 (diff) | |
download | SkyblockMod-8b78e680240a20d1b44c03f6bbcbb42b36a02827.tar.gz SkyblockMod-8b78e680240a20d1b44c03f6bbcbb42b36a02827.tar.bz2 SkyblockMod-8b78e680240a20d1b44c03f6bbcbb42b36a02827.zip |
Add low health alerts
Diffstat (limited to 'src/main/java/me/Danker/TheMod.java')
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 7c821fd..55ec20e 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -2519,7 +2519,7 @@ public class TheMod // Checks 5 times per second if (tickAmount % 4 == 0) { - if (ToggleCommand.blazeToggled && Utils.inDungeons && world != null) { + if (ToggleCommand.blazeToggled && Utils.inDungeons && world != null) { List<Entity> entities = world.getLoadedEntityList(); int highestHealth = 0; highestBlaze = null; @@ -2563,6 +2563,19 @@ public class TheMod } } + // Checks 10 times per second + if (tickAmount % 2 == 0) { + if (ToggleCommand.lowHealthNotifyToggled && Utils.inDungeons && world != null) { + List<String> scoreboard = ScoreboardHandler.getSidebarLines(); + for (String score : scoreboard) { + if (score.endsWith("❤") && score.matches(".*§c\\d.*")) { + Utils.createTitle(EnumChatFormatting.RED + "LOW HEALTH!", 1); + break; + } + } + } + } + if (titleTimer >= 0) { if (titleTimer == 0) { showTitle = false; |