Solved Check if one piece of player armour is not equipped

Discussion in 'Spigot Plugin Development' started by asdasaf, Jan 14, 2022.

Thread Status:
Not open for further replies.
  1. I need to check getBoots, chestplate, leggings and boots at one time if they all equals to null do thing here's the code what i wrote
    Code (Java):
    If(inventory.getBoots() == null){

    }
    I tried to combine them into
    Code (Java):
    If (inventory.getBoots == null) && (inventory.getChestplate == null) && (inventory.getHelmet == null) && (inventory.getLeggings == null){

    }
    But i got the same issue, if player equipped 1 piece of armour the code which i wrote not working. How do i check if the whole set equals to null?
     
  2. if(something || something) -> if(something or something)


    Code (Java):
    if (inventory.getBoots() == null || inventory.getChestplate() == null || inventory.getHelmet() == null || inventory.getLeggings() == null){

    }
     
  3. I think i need learn some java before coding thank you
     
    • Agree Agree x 1
    • Funny Funny x 1
    • Optimistic Optimistic x 1
Thread Status:
Not open for further replies.