Data Values

Discussion in 'Plugin Development' started by nmc94, Jul 18, 2011.

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

    nmc94

    Hey, Could someone help me out on how to allow players to use data values in a command. For example, /hat 35:2
     
  2. Offline

    bassfader

    These values are passed to the onCommand(CommandSender sender, Command command, String label, String[] args) method as String array (args[])
     
  3. Offline

    ItsHarry

    Use String.split

    Example:
    Code:
    String blah = "Hello world";
    String[] asd = blah.split(" ");
    System.out.println(asd[0]);
    System.out.println("Blah");
    System.out.println(asd[1]);
    
    Output would be:
    Hello
    Blah
    world
     
Thread Status:
Not open for further replies.

Share This Page