can't rotate player

Discussion in 'Plugin Development' started by CAUVMOU, Dec 23, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    CAUVMOU

    Hi, I'm new in Plugin Development, so I want to learn stuff, but I can't figure out why I can't turn the player.
    Please help.

    for (Player current : this.getServer().getOnlinePlayers()) {
    if (current.getName().equals(args[2])) {
    current.getLocation().setYaw(Integer.parseInt(args[3]));
    current.getLocation().setPitch(Integer.parseInt(args[4]));
    }
    }
     

    Attached Files:

  2. Offline

    timtower Administrator Administrator Moderator

    @CAUVMOU getLocation returns a copy of the location, you need to get the location, modify, then teleport the player.
     
Thread Status:
Not open for further replies.

Share This Page