From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Tue, 14 Jan 2020 19:43:40 -0600 Subject: [PATCH] Add wither skeleton takes wither damage option diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java index 8212ee2cc1242c0a3626f3643c455f3be0de18c2..aaf6f43c0f37a51a7b2db57b8da4336530664afe 100644 --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java @@ -139,6 +139,6 @@ public class WitherSkeleton extends AbstractSkeleton { @Override public boolean canBeAffected(MobEffectInstance effect) { - return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect); + return (level.purpurConfig.witherSkeletonTakesWitherDamage || effect.getEffect() != MobEffects.WITHER) && super.canBeAffected(effect); // Purpur } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index 928bddf54f77bd97cffc31e8bada979f42fb9120..2788371531f09876a4e5e0d53c58de631187410c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1278,6 +1278,7 @@ public class PurpurWorldConfig { public boolean witherSkeletonRidable = false; public boolean witherSkeletonRidableInWater = false; public double witherSkeletonMaxHealth = 20.0D; + public boolean witherSkeletonTakesWitherDamage = false; private void witherSkeletonSettings() { witherSkeletonRidable = getBoolean("mobs.wither_skeleton.ridable", witherSkeletonRidable); witherSkeletonRidableInWater = getBoolean("mobs.wither_skeleton.ridable-in-water", witherSkeletonRidableInWater); @@ -1287,6 +1288,7 @@ public class PurpurWorldConfig { set("mobs.wither_skeleton.attributes.max_health", oldValue); } witherSkeletonMaxHealth = getDouble("mobs.wither_skeleton.attributes.max_health", witherSkeletonMaxHealth); + witherSkeletonTakesWitherDamage = getBoolean("mobs.wither_skeleton.takes-wither-damage", witherSkeletonTakesWitherDamage); } public boolean wolfRidable = false;