2021-07-10 06:49:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Wed, 2 Dec 2020 21:03:02 -0800
|
|
|
|
Subject: [PATCH] Add config for mobs immune to default effects
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
2022-07-03 23:55:56 +02:00
|
|
|
index ca484fdd712a0815fc44521e42550b1529dc3edb..7f39a4955b4819e8a908f4cbf951d707c34fa4a8 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
2022-06-08 11:31:06 +02:00
|
|
|
@@ -1153,7 +1153,7 @@ public abstract class LivingEntity extends Entity {
|
2021-07-10 06:49:49 +02:00
|
|
|
if (this.getMobType() == MobType.UNDEAD) {
|
|
|
|
MobEffect mobeffectlist = effect.getEffect();
|
|
|
|
|
|
|
|
- if (mobeffectlist == MobEffects.REGENERATION || mobeffectlist == MobEffects.POISON) {
|
2022-06-09 10:51:45 +02:00
|
|
|
+ if ((mobeffectlist == MobEffects.REGENERATION || mobeffectlist == MobEffects.POISON) && this.level.paperConfig().entities.mobEffects.undeadImmuneToCertainEffects) { // Paper
|
2021-07-10 06:49:49 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
2022-06-09 10:51:45 +02:00
|
|
|
index 92734f767fde60351a179a88350a97b861be0e88..b3e2e834f4f151497bf842796dd8e3a8b5143f1b 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
2022-03-01 06:43:03 +01:00
|
|
|
@@ -612,7 +612,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
2021-07-10 06:49:49 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeAffected(MobEffectInstance effect) {
|
|
|
|
- return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect);
|
2022-06-09 10:51:45 +02:00
|
|
|
+ return effect.getEffect() == MobEffects.WITHER && this.level.paperConfig().entities.mobEffects.immuneToWitherEffect.wither ? false : super.canBeAffected(effect); // Paper
|
2021-07-10 06:49:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private class WitherDoNothingGoal extends Goal {
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
2022-06-09 10:51:45 +02:00
|
|
|
index 46779380f44a037d3915f287f40515a9bd31a439..c3085ad5410b41d9c7703b28ca835dbee3f49ee7 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
|
|
@@ -133,7 +133,7 @@ public class Spider extends Monster {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeAffected(MobEffectInstance effect) {
|
|
|
|
- return effect.getEffect() == MobEffects.POISON ? false : super.canBeAffected(effect);
|
2022-06-09 10:51:45 +02:00
|
|
|
+ return effect.getEffect() == MobEffects.POISON && this.level.paperConfig().entities.mobEffects.spidersImmuneToPoisonEffect ? false : super.canBeAffected(effect); // Paper
|
2021-07-10 06:49:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isClimbing() {
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
|
2022-06-09 10:51:45 +02:00
|
|
|
index ea6233cb3ca30864e54d553a5d1071ea9147a868..6449213d717271bcc516e393a78dfe1e5c762d68 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
|
2022-06-08 11:31:06 +02:00
|
|
|
@@ -123,6 +123,6 @@ public class WitherSkeleton extends AbstractSkeleton {
|
2021-07-10 06:49:49 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeAffected(MobEffectInstance effect) {
|
|
|
|
- return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect);
|
2022-06-09 10:51:45 +02:00
|
|
|
+ return effect.getEffect() == MobEffects.WITHER && this.level.paperConfig().entities.mobEffects.immuneToWitherEffect.witherSkeleton ? false : super.canBeAffected(effect); // Paper
|
2021-07-10 06:49:49 +02:00
|
|
|
}
|
|
|
|
}
|