Item IDs

Discussion in 'Plugin Development' started by wklock, Aug 23, 2012.

  1. Offline

    wklock

    So I've started a new plugin and I want to be able to use an unlisted block with the id 44:6 but I'm not sure how to implement it with Materials because it requires and integer.
     
  2. Are you trying to generate 44:6 using Bukkit?
     
  3. Offline

    wklock

    I'm trying to create a new recipe that gives the user 44:6
     
  4. Well, you can us getTypeId() == 44
     
  5. Offline

    wklock

    But it's a specific data type of item 44
     
  6. Or == 44.6)
     
  7. What is the code you have so far?
     
  8. Offline

    wklock

    Code (Text):
    1.         PluginDescriptionFile pdfFile = this.getDescription();
    2.         this.logger.info(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled.");
    3.         ShapedRecipe recipe1 = new ShapedRecipe(new ItemStack(Material("This is where the 44:6 needs to be") , 1));
    4.         recipe1.shape(new String[] { "AAA", "ABA", "AAA" });
    5.         recipe1.setIngredient('A', Material.SMOOTH_BRICK);
    6.         recipe1.setIngredient('B', Material.SMOOTH_BRICK);
    7.         getServer().addRecipe(recipe1);
    I haven't tested it yet.
     
  9. Here's the ItemStack you'll want to use for giving 44:6

    Code (Text):
    1. new ItemStack(Material.getMaterial(44), 1, (short) 0, (byte) 6)
     
    calebbfmv likes this.
  10. Grr I deleted my post because I had a typo, then you come in and say the same thing -____-
     
  11. Offline

    wklock

    Can you explain how that works please?
     
  12. Lol anyway, basically it says: Use the type 44, then add the subtype of 6 Right? or f***ed up?
     
  13. In that example, you're using the ItemStack costructor: ItemStack(Material type, Int amount, short damage, byte data)

    Basically:
    • Type: 44
    • Amount: 1
    • Damage: 0 (null)
    • data: 6 (The type)
    Put it all together, and you have 44:6
     
  14. Offline

    wklock

    Genius
     

Share This Page