Skip to content

Commit

Permalink
Fix llamas not being controllable with '/npc controllable' (#2412)
Browse files Browse the repository at this point in the history
Llamas are looped in with horses for certain traits (such as having an inventory) but not in movement. This commit excludes llamas from the `updateHorizontalSpeed` check as they cannot be controlled in vanilla.

Tested with 1.12.2 and 1.16.4.
  • Loading branch information
Camotoy committed Dec 21, 2020
1 parent 0111600 commit 91fcad1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void run(Player rider) {
boolean onGround = NMS.isOnGround(npc.getEntity());
float speedMod = npc.getNavigator().getDefaultParameters()
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
if (!Util.isHorse(npc.getEntity().getType())) {
if (!Util.isHorse(npc.getEntity().getType()) || npc.getEntity().getType().name().equals("LLAMA") || npc.getEntity().getType().name().equals("TRADER_LLAMA")) {
// just use minecraft horse physics
speed = updateHorizontalSpeed(npc.getEntity(), rider, speed, speedMod);
}
Expand Down

0 comments on commit 91fcad1

Please sign in to comment.