Stained Glass

Discussion in 'Plugin Development' started by Elimnator, Dec 11, 2013.

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

    Elimnator

    Giving myself stained glass isn't working, no mater what sub-value I put it always gives me white.

    Code:
    ItemStack glass = new ItemStack(95, 1, (short) 5);
    player.getInventory().addItem(glass);
     
  2. Offline

    L33m4n123

    Isn't it

    Code:
    ItemStack(Material.STAINED_GLASS, 1, (byte) 5);
     
  3. Offline

    Elimnator

    95 is the id for stained glass, it should work both ways.
     
  4. Offline

    L33m4n123

    look especialy at (byte) 5 and not (short) 5
     
  5. Offline

    Elimnator

    NVM it works.
     
  6. Offline

    MrDynamo

    I may be wrong, but I think you should get in the habit of using names instead of ids since minecraft will be eliminating ids.
     
  7. Offline

    Elimnator

    Yes, but I have a config file where people enter ids for items, none knows the "proper" names for stuff.
     
  8. Offline

    Not2EXceL

    Then just convert them from id's to the names.
     
  9. Offline

    Elimnator

    How? I'm not checking for each id individually.
     
Thread Status:
Not open for further replies.

Share This Page