Add config for allowing Endermen to despawn even while holding a block

This should help to reduce the amount of dirt, gravel, grass, and etc. that Endermen like to randomly place all over the world.
This commit is contained in:
Jason Penilla
2025-01-09 20:33:54 -08:00
committed by granny
parent 5055e6adb9
commit 4346cee03f
3 changed files with 11 additions and 42 deletions

View File

@@ -8,6 +8,15 @@
} else {
boolean flag = damageSource.getDirectEntity() instanceof ThrownPotion;
if (!damageSource.is(DamageTypeTags.IS_PROJECTILE) && !flag) {
@@ -440,7 +_,7 @@
@Override
public boolean requiresCustomPersistence() {
- return super.requiresCustomPersistence() || this.getCarriedBlock() != null;
+ return super.requiresCustomPersistence() || (!this.level().purpurConfig.endermanDespawnEvenWithBlock && this.getCarriedBlock() != null); // Purpur - Add config for allowing Endermen to despawn even while holding a block
}
static class EndermanFreezeWhenLookedAt extends Goal {
@@ -484,6 +_,7 @@
@Override