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 36910e03941171cbfa3c61b2aff7535a2920ce24..b252d9a254aedcdd67169e793b08dc093fd4829c 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 ccf56c1a804dad02faa16a8ba8efad2c3b3a59a2..7ff3ed217a9e4eaa9427c75993aff33515649e6a 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -1672,6 +1672,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); @@ -1691,6 +1692,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); }