Check hot bar switch event

Discussion in 'Plugin Development' started by themuteoneS, May 2, 2013.

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

    themuteoneS

    How can I check when someone changes which item they have selected?
     
  2. Offline

    Cybermaxke

    You have to use the ItemHeldEvent
     
  3. Offline

    themuteoneS

    Doesn't exist...
     
  4. Offline

    Morthis

    What do you need to do with it? If you need to do something just when they're holding an item, you're probably stuck setting up a repeating task that checks for the item each player is holding. If they have to do something with the item like clicking, then obviously you can just wait for a PlayerInteractEvent and check the item then.
     
  5. Offline

    BajanAmerican

  6. Offline

    themuteoneS

    Well I want to know the moment the player switches items. What does getCrusor() return?
     
  7. Offline

    BajanAmerican

  8. Offline

    Cybermaxke

    It was PlayerItemHeldEvent
     
  9. Offline

    themuteoneS

    Fixed but what happens if you open inventory, then getCrusor should return what is on the mouse and that would break my plugin.
     
Thread Status:
Not open for further replies.

Share This Page