ProtocolLib input?

Discussion in 'Plugin Development' started by Symphonic, Jan 21, 2020.

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

    Symphonic

    All I want to do is sit a player on an entity, doesn't matter what kind (can't be a boat because boats hate rotating when players are in them) and get player WASD input. I can't figure out how though, I have tried VEHICLE_MOVE but that only gets coordinates, and I cant use the boat_move one (even though it's perfect) because it's a boat and there's no way to rotate it for the client when the player is in it. Help?
     
  2. Offline

    Symphonic

  3. Offline

    Niv-Mizzet

    @Symphonic how about VehicleMoveEvent:https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Vehicle.html
    Note that this only works with boats, horses, pigs with saddles, etc.
    This should also help if you don't end up using LauchProjectile:https://hub.spigotmc.org/javadocs/b...icle.html#setVelocity-org.bukkit.util.Vector-(a way to get velocity included)

    If none of these works to get input you could use a prompt: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/conversations/Prompt.html, though I don't know if you need to use a chat window
     
    Last edited: Jan 25, 2020
  4. Offline

    Symphonic

    How do those conversation things work?
     
  5. Offline

    timtower Administrator Administrator Moderator

    Conversation API uses the enter though I believe, it doesn't listen as they type.
     
  6. Offline

    Symphonic

    Does anyone know how Hypixel gets input for their custom Mariokart game then? I feel like theres some simple solution
     
  7. Offline

    Niv-Mizzet

    @Symphonic I don't think Hypixel runs on Bukkit, they probably use a custom API.
    As for protocolLib, i haven't watched the full video, but it looks like they check for input here:
    I may be wrong
    Also, you could just not have the ship be constantly moving and use a combination of getVehicleMove and set/getVelocity
     
  8. Offline

    Symphonic

    Whatever they use must still be based off NMS.. speaking of which, is there any way to see the code of NMS classes? I see that SimplePets used NMS for their input but I’m not sure how they are doing it in 1.15.

    What do you mean by getVehicleMove?
     
  9. Offline

    Niv-Mizzet

  10. Offline

    Symphonic

    Yeah I looked at the simplepets github, it looks like they havent put in the same NMS thing for 1.15 as 1.14 so I don't know what the method is

    EDIT: also I can't use VehicleMoveEvent because it will be called when the velocity is changed etc not just when the player controls it
     
    Last edited: Jan 30, 2020
  11. Offline

    Symphonic

  12. Offline

    Niv-Mizzet

  13. Offline

    Symphonic

    can you change the relative position of riding entities though?

    plus could I get a tiny bit of example code? I'm still not sure how this will help me get input
     
  14. Offline

    Symphonic

  15. Offline

    Symphonic

  16. Offline

    Symphonic

Thread Status:
Not open for further replies.

Share This Page