Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5622

isSprinting() bug...Again

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • Ubuntu 19.10

      Java 1.8

      Server version: 1.14 *not latest build

    • git-Spigot-093165d-ba575a5 (MC: 1.14.2)
    • Yes

      Hello md_5.

      I want to start by saying I know there are already some isSprinting issues and you closed them, by saying it is a client bug. But still I want to report it and ask you what do you mean by that it is a client bug.

      Also I want to say that I am not using the latest build version, but as far as I see in the spigot source code, the issue should still be there.

      When you damage an entity, no matter of it's type, the spigot API says the player is not running, which is not true in the client, to reproduce it you simply need to run towards and enemy using the "double W" and hit the enemy, it is strange although, that I can reproduce it, but still you can't so please if you have questions, about the enviroment, or may you want me to test it with the latest version say in the comments.

      Sample code:

       

      boolean sprint = false;
      
      @EventHandler
      public void event(PlayerMoveEvent e) {
           p.getPlayer().sendMessage("isRunning: " + e.getPlayer().isSprinting()+" " + sprint + " " + ((CraftPlayer) p.getPlayer()).getHandle().isSprinting());
      }
      
      @EventHandler
      public void event(PlayerToggleSprintEvent e) {
           sprint = e.isSprinting();
      }

       

      Try test it, and for my hope, you will see these 3 methods of detecting sprint are different, they show different results when hitting an entity!

       

      Actually sprint boolean works perfectly. But using isSprinting() method on Player object is not working correctly here. After I opened the source code of Spigot, I actually saw that it is calling the isSprinting() method on EntityPlayer, so I tested it out also.

      It seems like this method in the nms EntityPlayer is actually the problem, which if I am right, I know it's not really a spigot issue, but you can change the realisation of isSprinting() method in the Spigot Player class, by using the event.

      I tested also to see if the client sent packet to stop runnig, actually it does not! The player is not sending NO_SPRINT packet, and so the toggle sprint event works perfectly. Tested with ProtocolLib.

       

      Thank you for your time, correct me if I am wrong, but I don't think it's a client bug, but NMS one!

       

            Unassigned Unassigned
            Dakata Daniel Gyudzhenev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: