Solved getBoolean() is returnin the value?

Discussion in 'Plugin Development' started by Gonmarte, Oct 23, 2015.

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

    Gonmarte

    Hi,
    The method getBoolean returns the value(e.g, in my config i have value: true) that i have? What i mean is if in the config is true it would run the code, but if its false it wouldnt..
    Its Correct What i sad?
    Code:
    if(cmd.getName().equalsIgnoreCase("hi"){
      if(this.getConfig().getBoolean("value")){
              player.sendMessage("I hope you help me =)");
    }
      
    }
    
    CONFIG
    Code:
    value: true
    
     
  2. Offline

    teej107

  3. @Gonmarte
    What was stopping you from trying this?
     
  4. Offline

    Gonmarte

    @teej107 So if i have false in the config it wont run the code right?
    @Assist My dad.
     
  5. Offline

    teej107

    Do you know how if statements work? Maybe it would also help to read the JavaDocs for that method. It states:
    In both of your examples, a boolean exists. Now tell me this. What do you think will happen?
     
  6. Offline

    Gonmarte

    @teej107 it would return false right?
     
  7. @Gonmarte If it is false yes it will return false. It wont return true if it's false.
     
    Scimiguy likes this.
  8. Offline

    teej107

    Yes and will the code inside the if statement run when the condition is false?
     
  9. Offline

    Gonmarte

  10. Offline

    Scimiguy

    @Gonmarte
    Um..

    Mark this thread as solved..
     
Thread Status:
Not open for further replies.

Share This Page