diff --git a/src/main/java/net/minestom/server/listener/PlayerVehicleListener.java b/src/main/java/net/minestom/server/listener/PlayerVehicleListener.java index 0c3c4ac25..090744a22 100644 --- a/src/main/java/net/minestom/server/listener/PlayerVehicleListener.java +++ b/src/main/java/net/minestom/server/listener/PlayerVehicleListener.java @@ -36,8 +36,10 @@ public class PlayerVehicleListener { public static void boatSteerListener(ClientSteerBoatPacket packet, Player player) { final Entity vehicle = player.getVehicle(); + /* The packet may have been received after already exiting the vehicle. */ + if (vehicle == null) return; if (!(vehicle.getEntityMeta() instanceof BoatMeta boat)) return; boat.setLeftPaddleTurning(packet.leftPaddleTurning()); boat.setRightPaddleTurning(packet.rightPaddleTurning()); } -} +} \ No newline at end of file