Help with string builder to turn into itemstack

Discussion in 'Plugin Development' started by AdamDev, Aug 21, 2017.

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

    AdamDev

    Hi, back again with another post. As the title goes I need help from getting the players message. In my plugin there's a command that is /setmaterials examplemine <materials>. So for say they do /setmaterials AMine stone,coal_ore,iron_ore. I want to get the materials and then fill the mine with these materials.

    Is there anyway of me doing this?
    Edit: Tell me if you need code I'll paste it
     
  2. If no space between each material, you can just split the second string argument by the comma.

    Code:
    String[] s = "iron_ore,diamond_ore,coal_ore".split(",");
     
  3. Offline

    AdamDev

    @RaxiCax
    That would work but, it's what they want to put not what I put in the plugin.
     
    Last edited: Aug 21, 2017
  4. Offline

    Zombie_Striker

    @AdamDev
    Use Material.getMaterialByName to convert Strings to material types.
     
Thread Status:
Not open for further replies.

Share This Page