From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: galacticwarrior9 Date: Thu, 14 Apr 2022 17:48:07 +0100 Subject: [PATCH] Config to prevent horses from standing when hurt Horses have a chance to stand when their hurt noise plays (i.e. when taking damage). This patch adds an option to toggle this behaviour ('stand-when-hurt'). diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java index 7466c437b2e996f16a08aaefc5c2b7cba216a14c..205ce2bd91a98a0c67d3c5dd640eb88c052f9425 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java @@ -388,7 +388,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @Nullable @Override protected SoundEvent getHurtSound(DamageSource source) { - if (this.random.nextInt(3) == 0) { + if (this.level.purpurConfig.horseStandWhenHurt && this.random.nextInt(3) == 0) { // Purpur this.stand(); } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 65236d76e7b3c4bd0a493529eebc5b3f971fbfb2..64f580007451ff1b5d8efd9ffc9d70a97bf76441 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -1707,6 +1707,7 @@ public class PurpurWorldConfig { public int horseBreedingTicks = 6000; public boolean horseTakeDamageFromWater = false; public boolean horseStandWithRider = true; + public boolean horseStandWhenHurt = true; public boolean horseAlwaysDropExp = false; private void horseSettings() { horseRidableInWater = getBoolean("mobs.horse.ridable-in-water", horseRidableInWater); @@ -1726,6 +1727,7 @@ public class PurpurWorldConfig { horseBreedingTicks = getInt("mobs.horse.breeding-delay-ticks", horseBreedingTicks); horseTakeDamageFromWater = getBoolean("mobs.horse.takes-damage-from-water", horseTakeDamageFromWater); horseStandWithRider = getBoolean("mobs.horse.stand-with-rider", horseStandWithRider); + horseStandWhenHurt = getBoolean("mobs.horse.stand-when-hurt", horseStandWhenHurt); horseAlwaysDropExp = getBoolean("mobs.horse.always-drop-exp", horseAlwaysDropExp); }