diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index bef8fbf8d..53fee13c0 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -265,6 +265,8 @@ public class Config extends AutoUpdateConfigLoader { public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); } public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); } + public boolean getMobHealthbarEnabled() { return config.getBoolean("Mob_Healthbar.Enabled", true); } + /* Mob Healthbar */ public MobHealthbarType getMobHealthbarDefault() { try { diff --git a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java index dad16a344..80aba150e 100644 --- a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java @@ -16,7 +16,7 @@ import com.gmail.nossr50.runnables.MobHealthDisplayUpdaterTask; import com.gmail.nossr50.util.player.UserManager; public final class MobHealthbarUtils { - private MobHealthbarUtils() {}; + private MobHealthbarUtils() {} /** * Fix issues with death messages caused by the mob healthbars. @@ -40,7 +40,7 @@ public final class MobHealthbarUtils { * @param damage damage done by the attack triggering this */ public static void handleMobHealthbars(Player player, LivingEntity target, double damage) { - if (mcMMO.isHealthBarPluginEnabled() || !Permissions.mobHealthDisplay(player)) { + if (mcMMO.isHealthBarPluginEnabled() || !Permissions.mobHealthDisplay(player) || !Config.getInstance().getMobHealthbarEnabled()) { return; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 152e24029..b03fea08a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -102,8 +102,10 @@ Scoreboard: LevelUp_Time: 5 Mob_Healthbar: - # Display_Type: Default display for mob health bars - HEARTS, BAR, or DISABLED + # Enabled: Whether or not the feature is enabled at all + # Display_Type: Per player Default display for mob health bars - HEARTS, BAR, or DISABLED # Display_Time: Amount of time (in seconds) to display. To display permanently, set to -1 + Enabled: true Display_Type: HEARTS Display_Time: 3