Open Poswn opened 3 years ago
I'm using the latest version of Nukkit at the time of this issue opened, commit 90cd601
of the master
branch.
If you want to test this easily, you can fly high up in air, drop & whilst falling say something random in chat to run the method to teleport you, you can change the x
, y
or z
values in the teleportToSpawn
method so that there is a block under your feet when you teleport.
@EventHandler
public void onPlayerChat(PlayerChatEvent event) {
teleportToSpawn(event.getPlayer());
}
public void teleportToSpawn(Player player) {
player.teleport(new Location(
0, // X-Coordinate
50, // Y-Coordinate
0, // Z-Coordinate
90, // Yaw
0)); // Pitch
}
Not sure but this issue from Pocketmine may be possibly related or not.
https://github.com/pmmp/PocketMine-MP/issues/821
Expected Behavior
Teleporting a player to a location with yaw & pitch values passed in will set the player's yaw & pitch to the defined values no matter what.
Actual Behavior
If you teleport a player to a location whilst they are moving such as falling, the yaw & pitch will be incorrect at their teleport location (x, y, & z coordinates are correct).
Steps to Reproduce
Teleport a player to a location whilst they are moving such as falling using code below. If the player isn't moving the yaw & pitch will be correct at the teleport location.
Debug information
Checklist:
/debugpaste
link