Skip to content

Commit 11e7dd9

Browse files
committed
Fix llama not moving when ridden
1 parent d0b705e commit 11e7dd9

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

purpur-server/minecraft-patches/features/0001-Ridables.patch

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2384,7 +2384,7 @@ index 2a1d720557c0bd4895a32723e34512c0a557e4f2..f1cb2e315e1d86f9fcd87db11d3ee7a8
23842384
protected void randomizeAttributes(RandomSource random) {
23852385
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(generateMaxHealth(random::nextInt));
23862386
diff --git a/net/minecraft/world/entity/animal/horse/Llama.java b/net/minecraft/world/entity/animal/horse/Llama.java
2387-
index 5e3382351b1b5728750534f64babc85c4da3ac54..da6450f7573ca9797577d5afae2bb1365d112177 100644
2387+
index 5e3382351b1b5728750534f64babc85c4da3ac54..cb7af093a452b6febf6727e934e1492b67fbc18b 100644
23882388
--- a/net/minecraft/world/entity/animal/horse/Llama.java
23892389
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
23902390
@@ -84,7 +84,51 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
@@ -2455,6 +2455,18 @@ index 5e3382351b1b5728750534f64babc85c4da3ac54..da6450f7573ca9797577d5afae2bb136
24552455
this.targetSelector.addGoal(1, new Llama.LlamaHurtByTargetGoal(this));
24562456
this.targetSelector.addGoal(2, new Llama.LlamaAttackWolfGoal(this));
24572457
}
2458+
@@ -540,4 +586,11 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
2459+
return this.name;
2460+
}
2461+
}
2462+
+
2463+
+ @Nullable
2464+
+ @Override
2465+
+ public LivingEntity getControllingPassenger() {
2466+
+ Entity firstPassenger = this.getFirstPassenger();
2467+
+ return !this.isNoAi() && firstPassenger instanceof net.minecraft.world.entity.Mob mob && firstPassenger.canControlVehicle() ? mob : null;
2468+
+ }
2469+
}
24582470
diff --git a/net/minecraft/world/entity/animal/horse/Mule.java b/net/minecraft/world/entity/animal/horse/Mule.java
24592471
index 39725b7a6bac9390406733cd51d7341d0cb363d1..b1c96936ba8dcba4435a649dd7e6ec3c921c3702 100644
24602472
--- a/net/minecraft/world/entity/animal/horse/Mule.java

0 commit comments

Comments
 (0)