Solved If certain xp amount

Discussion in 'Plugin Development' started by thechrisanator, Apr 17, 2017.

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

    thechrisanator

    How would I make it so that if a player doesnt have X amount of xp, then they cant equip a certain armour? And if that happens when they try to put it on their person, it would go back to their inv or their cursor.
     
  2. Offline

    The Uprising

    exp levels or exp?
     
  3. Offline

    GRocksMc

    You could do:
    Code:java
    1.  
    2. //Use InventoryClickEvent and check if the item is going into the armor slots
    3.  
    4. //to check exp
    5. if(PLAYER#getExpToLevel() < 5){
    6. EVENT#setCancelled(true);
    7. }
    8.  


    Just wrote this, but I hope this gives you some idea.
     
  4. Offline

    thechrisanator

    @GRocksMc yeah, thats helps. thx!


    Does anybody know how to see if somebody shift-clicks in an inventory?
     
  5. Offline

    Ragnarok_

    @thechrisanator
    You can use a InventoryClickEvent and make an if statement whether it was a shiftclick, if it was, do whatever.
     
  6. Offline

    thechrisanator

  7. Offline

    GRocksMc

    @thechrisanator

    If you no longer have a problem, please mark the thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page