Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player Teleport/Movement Bug #1815

Open
3 tasks done
Poswn opened this issue Mar 27, 2021 · 3 comments
Open
3 tasks done

Player Teleport/Movement Bug #1815

Poswn opened this issue Mar 27, 2021 · 3 comments

Comments

@Poswn
Copy link

Poswn commented Mar 27, 2021

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.

public void teleportToSpawn(Player player) {
    player.teleport(new Location(
            0, // X-Coordinate
            50, // Y-Coordinate
            0, // Z-Coordinate
            90, // Yaw
            0)); // Pitch
}

Debug information

Checklist:

  • [] I included a /debugpaste link
  • I made sure there aren't duplicates of this report (Use Search)
  • I made sure I am using an up-to-date version of Nukkit
  • I Made sure the bug/error is not caused by a plugin
@Poswn
Copy link
Author

Poswn commented Mar 27, 2021

I'm using the latest version of Nukkit at the time of this issue opened, commit 90cd601 of the master branch.

@Poswn
Copy link
Author

Poswn commented Mar 27, 2021

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
}

@Poswn
Copy link
Author

Poswn commented Mar 27, 2021

Not sure but this issue from Pocketmine may be possibly related or not.
https://github.com/pmmp/PocketMine-MP/issues/821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant