1.14.4 Smooth head rotation for player?

Discussion in 'Spigot Plugin Development' started by Streampy, Feb 20, 2020.

  1. Hey,
    I am currently working on my project but my question is: is there a way to rotate the player view smooth? Instead of teleporting him too the same location and changing the pitch/yaw. Because it little bit rough?

    I have thinking if it is possible with velocity? for the head rotation. My character will not move only his head will be rotating around (the player should not be enable to move at that moment) so the head rotation has to come from the plugin.
     
  2. Try using ProtocolLib, assuming you are new with packets.
    Do you know how the ProtocolLib dependancy works?
    Send packets to the player, so you can have your plugin not dependant, so you can do this without NMS.
     
  3. I am not new with packages :p I will show you what my problem is with this video


    I want to get a smooth rotation on the same location (the vector post didn't help me because I know how to get the vector of the direction but if I add it to the players location it doesn't do anything
     
  4. When you use the teleport function for the player class just change the yaw/pitch of the location you are teleporting to the player's current yaw/pitch.
     
  5. Code (Java):
    for (Player p : camera.getConnected()) {
                   if (p != e.getPlayer()) {
                       p.teleport(e.getPlayer());
                   }
               }
    but this is in a player move event and maybe you know but a player move event won't be triggered by every movement of a player only a x amount of change will update it for the movement event.
    Edit: packets won't be a good option (personally I think) they are for myself less stable and I don't want too use outside plugins like protocollib because it has to be a standalone plugin
     
  6. Wha.. what are you talking about? His problem is not related to packets at all.
    You can try to use additional entity. Make player sit on it or enforce player to spectate this entity. Instead of teleporting player around - teleport entity.
     
  7. Spectating isn't also not a option has to be in survival, I have think and used a way to change the view of the player in the armorstand but that doesn't work if the armorstand is outside of your view side.
     
  8. And protocollib is not the only library for packets.
    Use NMS if you wished or tinyprotocol(inside your project), but give credit.
     
  9. The only thing that I need is a smooth rotation from pitch/yaw 1 to pitch/yaw 2. And has to get from a player movement event because all players in the list has to follow what player1 sees
     
  10. Oh, hm...
    I understand what you want now.
    I didn't really understand what you are tryna make.
    So a 1st person spectator.
    You want it to be smooth for the players.
     
  11. There's no options then. Minecraft is not friendly to this kind of things, and the only option is to use another entity(or use modified client, idk), because client smoothing movement of other entities but not own. That's all.
     
  12. They are viewing what a users sees and that user is controlling a armorstand that is looking at that direction what the 'main' player is watching too.
    And now the spectators has to see the same but in survival
     
  13. The only way that I can think is setting the view on the armorstand itself after I teleported him in the armorstand so the view distance will be the same. So that must be packets without it, its impossible what you are saying