If player presses jump button?

Discussion in 'Plugin Development' started by Metal Julien, Nov 7, 2012.

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

    Metal Julien

    Hi, is there a way to check, if a player presses a button f.a. the jump button? :)

    Metal_Julien
     
  2. Offline

    Woobie

    Metal Julien
    Nope, but you can detect when player jumps
    Code:
    @EventHandler
    public void onMove(PlayerMoveEvent event){
    if(event.getFrom().getY()<event.getTo().getY()){
    //stuff 
     
  3. Offline

    Metal Julien

    Och. When my player sits in a Minecart, it isn't possible? :(
     
  4. Offline

    MisterErwin

    I think:
    if (event.getPlayer().getVehicle() instanceof Minecart)

    Or like that...

    €: Use playerInteractEvent and check, if the block is a button...
     
  5. Offline

    Lolmewn

    Maybe Packets, not sure otherwise.
     
  6. Offline

    Malikk

    With Spout you can listen to actual key presses, but I'm not sure of a Bukkit way to do this if the player is in a minecart.
     
  7. Offline

    fireblast709

    Bukkit does not listen to keys (sadly enough)
     
  8. Offline

    Metal Julien

    Oh :( Yh but Spout needs an own client :S But thx
     
  9. Offline

    thehutch

    You need a client to listen to the keys, Bukkit is server sided only :( I'd suggest Spout because it is the best :p
     
    Metal Julien likes this.
  10. Offline

    creepycrafter4


    says the spout admin????
     
  11. there are too much spout suggesting on this site. people ask for bukkit help, if it can't be done with bukkit, it can't be done, but people suggest spout before it's even been verified it dont work with bukkit
     
  12. Offline

    Malikk

    If you've got an idea let's hear it.

    If it can't be done with Bukkit, but it can with Spout, what's so bad about simply saying it?

    Bukkit doesn't have a client mod, which is nice for the sake of compatibility, but that means that it will never be able to do a lot of the things that Spout can. And learning Spout isn't difficult. If you're already developing for Bukkit you can do all the same things and more.

    I'm not sure why so many people are against Spout. I tend to make my plugins as straight bukkit as I can, but then add in Spout features that people can turn on and off. It's a really nice platform that gives you a lot more freedom than you would otherwise have only using Bukkit.
     
    thehutch likes this.
  13. Offline

    fireblast709

    Malikk the fact spout needs a client is kinda lowering the user-friendliness of plugins. Note that I am not saying it is bad, its just as it is

    Metal Julien Its a unstable method, and might lag your server badly, but on the PlayerMoveEvent you might check if the velocity has a certain y value
     
  14. Offline

    Malikk

    I'm just saying, if Bukkit can't do it, you can use Spout or you can forget about that feature. Some features can be optional, which is when it's nice to add Spout support. But I agree that its much better to keep the compatibility of Bukkit if at all possible.

    Back on topic, lol. He can't listen to playerMove because the player he needs will be sitting in a minecart, which is why he was asking about key presses.

    @Metal Julien
    Maybe explain what you need this for and we can come up with another way to do this that wouldn't need Spout/key presses.
     
  15. Offline

    devilquak

    That's not Afforess :p

    Take a look at his name.
     
    thehutch likes this.
  16. Offline

    thehutch

    I am no Afforess :p

    Nope, I think you'll find that the only way for him to see if someone jumps ("reliably") is to have a modded client and Spoutcraft is the best for this,. Also Bukkit will be dead soon so you might as well choose now Spout or MinecraftAPI.

    It doesn't low the "user-friendliness" it gets the job done the only way which is possible so if you want the features which Spout offers and Bukkit doesn't then get the client. In fact you can still have Spout plugin's without users having the client so your argument is invalid :D
     
  17. Offline

    fireblast709

    What I mean was that IF people want the features, they would have to get a modded client. So in a sense of the case, it is player unfriendly
     
  18. Offline

    thehutch

    So if someone does want the features how are they going to do it? Re-defy the laws of Physics so that the keyboard can be monitored from a server?
     
  19. Offline

    fireblast709

    thehutch I am not saying Spout is a bad thing, I'm just saying it is less user-friendly as people need another client to use those features. Please do not start a unneccesary discussion which is totally offtopic
     
  20. Offline

    SirTyler

    That topic went rouge fast. Spout provides the server access to the client, if someone (player OR server) does not want to use Spout then that is their choice. No one forces you to use spout, there is no gun to your head to make you use it.

    Now, back on topic; Simply put you can not listen for the actual pressing of buttons, you can however listen for when the player is in the air and has (in theory) jumped.
     
  21. Offline

    Malikk

    The OP wants to know if the player has pressed the jump key, but they are sitting in a minecart, so PlayerMove isn't going to work for this situation either.
     
  22. Offline

    SirTyler

    Then they are shit out of luck without Spout (or another mod), end of story.
     
    fireblast709 likes this.
  23. Offline

    devilquak

    User-friendliness isn't even remotely the issue here, the fact of the matter is that it's simply impossible for Bukkit alone to detect client actions, such as key presses. The Minecraft client itself doesn't actually tell the server anything when keys are pressed, only the actions they incur on the server, and that's where Spout comes in. A modified client is needed to force the client to send key presses to the server, it's not because the Bukkit staff is too lazy to code it or hates intuitive software, it's because they plain and simply cannot do it.
     
  24. Offline

    Deleted user

    VehicleMoveEvent()
     
  25. Offline

    fireblast709

  26. Offline

    Deleted user

    My bad didn't get that part of the conversation, I just skimmed.
     
  27. It has been tested and No the Only way to track Player Key Presses is thought spout
     
  28. yes i know. i know for client sided things, spout is the answer.
    geez, but read what i wrote. i say people suggest spout too fast, without even knowing what they are talking about sometimes. i didn't mean this particular thread. man, can't people learn how to read? :S
     
  29. Offline

    Malikk

    Perhaps it's your terrible grammar and improper punctuation?
     
    xxCoderForLifexx likes this.
  30. does this not have the proper grammar and punctuation?:
    " there are too much spout suggesting on this site. "
     
Thread Status:
Not open for further replies.

Share This Page