cancel playerhead being placed in headgear slot

Discussion in 'Plugin Development' started by Rexel, Apr 3, 2014.

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

    Rexel

    has someone got any quick guide doing this.

    ie check if the player tried to put a head block(skull) in the headgear slot and cancel it unless they have a perm...

    unless this can be done already with one of the existing plugins already out?
     
  2. Offline

    Qwertyness_

    You can listen on an InventoryClickEvent, check the slot clicked with getSlot(), and then either check getCursor() or getCurrentItem(), depending when the method is called in relation to the actual place action. Not completely sure on that, but some experimenting will solve that quickly for you.

    Then you just check the perms and such in the listener method and cancel if they don't have the needed perm. None of this is tested, just off the top of my head, so sorry if it doesn't work!
     
Thread Status:
Not open for further replies.

Share This Page