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
|
2023-09-10 04:28:03 +02:00
|
|
|
index ad613b0d6c430a52ee706064c8638a643c2c5ffa..2cb08ccd53a1548c1e65065a4eeb5e4f577e34a6 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
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -1163,7 +1163,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
2021-07-10 06:49:49 +02:00
|
|
|
if (this.getMobType() == MobType.UNDEAD) {
|
|
|
|
MobEffect mobeffectlist = effect.getEffect();
|
|
|
|
|
|
|
|
- if (mobeffectlist == MobEffects.REGENERATION || mobeffectlist == MobEffects.POISON) {
|
2023-06-08 21:00:58 +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
|
2023-07-04 10:22:56 +02:00
|
|
|
index cd59500565a305757872aaf41b03b49ffc005af5..703068eaff84bcce83f61d805afa6cc0fef909b1 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
|
2023-03-14 21:25:13 +01:00
|
|
|
@@ -605,7 +605,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);
|
2023-06-08 23:13:43 +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
|
2023-06-08 21:35:20 +02:00
|
|
|
index b9acef460ff7e8bc9e24997771beeba6bea1f28a..d506091a739b04caf213e8fb0f71b5b78035aa0e 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);
|
2023-06-08 21:35:20 +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
|
2023-06-08 22:56:13 +02:00
|
|
|
index ea6233cb3ca30864e54d553a5d1071ea9147a868..9a81cb0c3a5ac40ff50dc7c81f6196a447cd03c6 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);
|
2023-06-08 22:56:13 +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
|
|
|
}
|
|
|
|
}
|