Solved How would i, create a command like /example help

Discussion in 'Plugin Development' started by theone1000, Jul 1, 2015.

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

    theone1000

    I know how to create commands but how would i create a command like shown below?


    EX: /build house

    Instead of /buildhouse






    Thanks for the help
     
  2. Offline

    Larsn

    Make a build command then make a if statement as listed below:
    Code:
    if(args[0].equalsIgnoreCase("house"){
         // DO something
    }
    EDIT:
    NOTE: Args count from zero
    0 1 2 3 4 5 6
    /build house some other args are listed here

    FMI: http://wiki.bukkit.org/Plugin_Tutorial
     
    theone1000 likes this.
  3. Offline

    theone1000

    Thank you so much = ]
     
  4. Offline

    Larsn

  5. Offline

    theone1000

  6. Offline

    Ruptur

    @theone1000
    No you dont need to define arguments into plugin.yml just the main command eg/example
     
  7. Offline

    TheFl4me

    Also don't forget to check:
    Code:
    if(args.length() == 1) {
    else you will get an error i believe
     
  8. Offline

    _Filip

    Or no arguments.......
     
    Last edited by a moderator: Jul 1, 2015
Thread Status:
Not open for further replies.

Share This Page