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-11-04 20:20:01 +01:00
|
|
|
index 1c8742e272e984d9a093d049b9420036ffc284a1..118f1c6a349ad49d87f14a1b8ae9ef64ccb1148a 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-09-22 09:24:44 +02:00
|
|
|
@@ -1165,7 +1165,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-09-22 09:24:44 +02:00
|
|
|
index 6241baccd3fdee59175f616cdf69d3873074f855..9e5d68fe86d17118df3d6a1c36b296f32b4d7fc1 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
|
2023-09-22 09:24:44 +02:00
|
|
|
@@ -135,7 +135,7 @@ public class Spider extends Monster {
|
2021-07-10 06:49:49 +02:00
|
|
|
|
|
|
|
@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-09-22 09:24:44 +02:00
|
|
|
index 62943d43b701d9ae6d955003f4e7658f76d5bdb3..3dcd43279ce1295b37c3504ecbdaac5275df2b80 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
|
2023-09-22 09:24:44 +02:00
|
|
|
@@ -128,6 +128,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
|
|
|
}
|
|
|
|
}
|