Solved turning string into itemstack?

Discussion in 'Plugin Development' started by vhbob, May 13, 2015.

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

    vhbob

    does anyone know how to turn a string into an itemstack??
     
  2. Offline

    nbrandwine

    Hah. If that's even possible you're going to have an odd time converting and using it.
     
  3. Offline

    Sparaat

    Not shure if this works...
    Code:
    new ItemStack(Material.getMaterial("<ITEMNAME>"),<AMOUNT>);
     
  4. Offline

    Zombie_Striker

    Well, since itemstacks contain a lot of information, you would need to know how to get all the information and compact it into a string, and then how to parse everything to make an itemstack. Here's an example.
    Code:
    plublic ItemStack decomplier(String s){
    // String may be STONE:1:4:LORE
    String [] sp = s.split(";")
    ItemStack .setType(Material.getMaterial(sp[0]))
    ect.
    }
     
  5. Offline

    mythbusterma

    @vhbob

    What are you trying to do?
     
  6. Offline

    ItsMattHogan

Thread Status:
Not open for further replies.

Share This Page