Solved 'OR' statement (Help needed)

Discussion in 'Plugin Development' started by ThunderWaffeMC, Feb 23, 2013.

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

    ThunderWaffeMC

    Hello. I'm trying to make it so the code acts like "If... you have the item 'sword1' from the config in your hands... OR... the item 'sword2' from the config..." then the code acts below. If you don't get it there's an example below which is not working for me:

    Code:Java
    1.  
    2. if(player.getInventory().getItemInHand().getType() == Material.matchMaterial(plugin.getConfig().getString("sword1"))) || (player.getInventory().getItemInHand().getType() == Material.matchMaterial(plugin.getConfig().getString("sword2"))) {
    3.  


    It says the error "the left hand side of an assignment must be a variable".

    Thanks in advance.
     
  2. I think you're missing a closing bracket at the end ).
    Because you have an opening bracket after the ||
     
  3. Offline

    ThunderWaffeMC

    It doesn't change anything.
     
  4. You've closed the condition before the OR came up.

     
    ThunderWaffeMC likes this.
  5. Offline

    ThunderWaffeMC

    Thanks very much.
     
Thread Status:
Not open for further replies.

Share This Page