player_button_press event

Discussion in 'Plugin Development' started by lemonzap, Jul 12, 2011.

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

    lemonzap

    I have started working on a plugin that will allow minecarts to be driven without rails placed before hand. I can think of two ways of doing this, automatically placing rails in front of the minecart while it travels, or just player controlled(press w and you go forward without any rails).
    either way each one has to have player button commands for while they are in the minecart. for example if you press w you begin to move forward, and the longer you hold it, the more you accelerate, and when you press a or d you change directions respectively, also s would be a brake. Does anyone know if there are player pressing and/or holding a keyboard button events?
     
  2. Offline

    ItsHarry

    Button pressing is client-sided, it's not possible through default Bukkit. But it might be possible using BukkitContrib
     
  3. Offline

    Haias

    I can't be sure because I've never tried something like this, but knowing that bukkit is meant for server software, I would think not.

    Though there's a slight chance that PlayerMoveEvent might be able to help you. However, based on its methods, I'm thinking it wouldn't fire at all when a player is in a minecart.
     
  4. Offline

    bleachisback

    Not in default bukkit, but using BukkitContrib, I believe you can
     
  5. Offline

    coder13

    couldn't you use a player interact event and check to see if the player interacted with a minecraft?
     
  6. Offline

    bleachisback

    You can use a VehicleEnterEvent, but then you wouldn't be able to control it, it would just automatically accelerate
     
  7. Offline

    lemonzap

    Thanks for the info, what exactly is bukkit contrib. I havent seen that before?
     
  8. Offline

    DrBowe

    While that would make everyone's life monumentally easier, that's not exactly how the whole "Server-Software" thing goes, bud.
    ;)
     
  9. Offline

    lemonzap

    so I have gotten started using bukkit contrib but im having trouble with the events. I havent any examples of key pressing events being used and the API doesnt apear very clear, maybe I missed something. alot of stuff about the keyboard and stuff that just doesnt seem to fit. any help?
     
  10. Couldn't he just hook into onPlayerInteract?
     
  11. Offline

    ItsHarry

    ^ No, he's talking about pressing WASD keys, I don't think it's possible through playerinteract
     
  12. My bad :p
     
  13. Offline

    captainawesome7

    Lol I thought he meant literally pressing a stone button in game too. It is possible with BukkitContrib to use key presses as an event hook but when I tested it I couldn't get it to work.
     
  14. Offline

    coder13

    Button* i have no idea why i type minecraft...
     
  15. Offline

    DrBowe

    Ok, that makes much more sense. :p
     
Thread Status:
Not open for further replies.

Share This Page