Solved Cancel void (OnCommand)

Discussion in 'Plugin Development' started by TGamingStudio, Nov 18, 2017.

Thread Status:
Not open for further replies.
  1. Hello i want do OnCommand Command . But i dont watnt have long code .... I want do if world doesnt exist skip code .
    So :
    Code:
    If(1args)
       do arg 1 is world
          if doesnt exist
             exid code
    else
        world is players world
    
    other things to do ... Same with 1 and 0 args but i dont want it if world doesnt exists
    please how to do this?
     
  2. Online

    timtower Administrator Administrator Moderator

  3. @timtower thank you :D i never do with return ... :/
    i am still learning java.

    So return false;
     
  4. Online

    timtower Administrator Administrator Moderator

    No, an onCommand that returns false tells that the plugin didn't handle it.
    Return true is what you need.
     
    TGamingStudio likes this.
  5. @timtower it worked for me with false.. ill try true

    it same works with true as false
     
  6. Online

    timtower Administrator Administrator Moderator

  7. it works like
    Code:
    else
            {
                 sender.sendMessage(ChatColor.translateAlternateColorCodes('&' , "&7[&6WorldTools&7] &4You are not a Player "));
                 return true;
            }
     
Thread Status:
Not open for further replies.

Share This Page