Getting a players item in hand when they change it via mouse clicks?

Discussion in 'Plugin Development' started by Lanuk, Oct 20, 2012.

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

    Lanuk

    So I am making a plugin that will basically change the mcMMO skills of a player when they have a certain item in their hand. I have been having a lot of trouble as it has been hard to account for each inventory event that could change the item in the player's hand.

    So far it will work when the player changes the numbered inventory slots (the main ones), but not when they drag and drop items into/out of their inventory slot. Basically, say a player is holding the item needed to boost their mcMMO levels, and they click it and drag it into another inventory slot. Their boosted skills will not go down.

    I am currently listening for the PlayerItemHeld event. Does anyone know how to account for clicking and dragging/dropping items, and if there is anything else (besides playerlogin, playeritemdrop, and playeritempickup events) I need to account for? Or is there an easier way to do this without creating lag on my server?

    Help would be appreciated, thanks!
     
  2. Offline

    BucketOfFun

    For clicking items (if you mean moving them around in their inventory) you could use InventoryClickEvent.
     
  3. Offline

    Lanuk

    ooh, thanks
     
Thread Status:
Not open for further replies.

Share This Page