Defining blocks

Discussion in 'Plugin Development' started by nopresnik, Jul 24, 2012.

  1. Offline

    nopresnik

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    How do I get the codes for sub items?
    SMOOTH_BRICK is for the smooth stone, but how do i get the cracked one? I tried CRACKED_BRICK but that didnt work :/

    Any help would be appreciated!
  2. Offline

    chaseoes BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)

    This post has been edited 1 time. It was last edited by chaseoes Jul 24, 2012.
  3. Offline

    Digi

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Cracked smooth brick and other variations are data values of smoth brick.
    All data values for all items/blocks: http://www.minecraftwiki.net/wiki/Data_value

    Depending on what you need it for you can use that data value to get or set the specific type of a block....

    For items:
    Code:
    ItemStack item = new ItemStack(material/typeid, amount, (short)data); // create item with id, amount, data
    
    item.setDurability((short)data); // to set the data value for an item
    item.getDurability() // to get the data value from the item
    item.getData() // will return a MaterialData class which has a .getData() which returns a byte, I don't recommend it
    For blocks is just .getData() and .setData().

    This post has been edited 2 times. It was last edited by Digi Jul 24, 2012.

Share This Page