Giving colored Stained Clay

Discussion in 'Plugin Development' started by MOMOTHEREAL, Aug 25, 2013.

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

    MOMOTHEREAL

    Hi everyone! I just wanted to know how I could add Colored Stained Clay in a custom inventory...
    I know how to add items to an inventory, but sadly not items/blocks with Data. I know you can do this with wool using the Wool class, but what about the clay... Thanks in advance! :) Momo
     
  2. Offline

    Loogeh

    MOMOTHEREAL I've never tried it with stained clay but does this work?
    Code:
    ItemStack stained_clay = new ItemStack(Material.STAINED_CLAY, 1, (short) 2);
    This should give magenta stained clay if it works. The data valueis the short
     
  3. Offline

    antflga

    It would be something like
    Code:java
    1. (Material.HARDENED_CLAY [item amount] (short) [dye number])
    2. //I didint do this in an ide so wont be perfect
     
  4. Offline

    MOMOTHEREAL

    hmmm sorry Loogeh antflga it still doesn't show up anything in the inventory
    Code:java
    1. compassinv.clear();
    2. ItemStack stained_clay1 = new ItemStack(Material.STAINED_CLAY, 1, (short) 2);
    3. compassinv.addItem(stained_clay1);


    Can any1 help please?

    EDIT: Actually works fine now :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
    maxmar628 likes this.
Thread Status:
Not open for further replies.

Share This Page