Configurable mob blindness

Ported from https://github.com/raltsmc/mobblindness
This commit is contained in:
Encode42
2025-01-11 18:41:14 -08:00
committed by granny
parent 9548eb8885
commit facd3e2900
3 changed files with 20 additions and 49 deletions

View File

@@ -31,6 +31,24 @@
}
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
@@ -1018,6 +_,17 @@
}
}
+ // Purpur start - Configurable mob blindness
+ if (lookingEntity instanceof LivingEntity entityliving) {
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
+ int amplifier = entityliving.getEffect(MobEffects.BLINDNESS).getAmplifier();
+ for (int i = 0; i < amplifier; i++) {
+ d *= this.level().purpurConfig.mobsBlindnessMultiplier;
+ }
+ }
+ }
+ // Purpur end - Configurable mob blindness
+
return d;
}
@@ -1372,6 +_,24 @@
this.stopSleeping();
}