Solved Disabling getting an item when logging

Discussion in 'Spigot Plugin Development' started by iChris, Jun 14, 2016.

  1. So i made this simple plugin when you log in, you get a compass..
    And whn i log out and come back it gives me another compass..

    What do I have to change in the code to say that
    If you already have a compass then you cant get another one when logging in?
     
  2. I actually just figured it out.. Nvm.
    PlayerQuitEvent
    p.getInventory().clear();
    p.getInventory().setHelmet(null);
    p.getInventory().setChestplate(null);
    p.getInventory().setLeggings(null);
    p.getInventory().setBoots(null);
     
  3. if you found your solution, please mark this thread as solved. Thx
     
  4. player.getInventory().setArmorContents(null);
     
  5. Yep thats also an option for shorter code.
    Thanks!