Item IDs

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

  1. Offline

    wklock

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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. Offline

    Timr

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Are you trying to generate 44:6 using Bukkit?
  3. Offline

    wklock

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I'm trying to create a new recipe that gives the user 44:6
  4. Offline

    calebbfmv

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Well, you can us getTypeId() == 44
  5. Offline

    wklock

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    But it's a specific data type of item 44
  6. Offline

    calebbfmv

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Or == 44.6)
  7. Offline

    calebbfmv

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    What is the code you have so far?
  8. Offline

    wklock

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Code:
            PluginDescriptionFile pdfFile = this.getDescription();
            this.logger.info(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled.");
            ShapedRecipe recipe1 = new ShapedRecipe(new ItemStack(Material("This is where the 44:6 needs to be") , 1));
            recipe1.shape(new String[] { "AAA", "ABA", "AAA" });
            recipe1.setIngredient('A', Material.SMOOTH_BRICK);
            recipe1.setIngredient('B', Material.SMOOTH_BRICK);
            getServer().addRecipe(recipe1);
    I haven't tested it yet.
  9. Offline

    Timr

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Here's the ItemStack you'll want to use for giving 44:6

    Code:
    new ItemStack(Material.getMaterial(44), 1, (short) 0, (byte) 6)
    calebbfmv likes this.
  10. Offline

    calebbfmv

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Grr I deleted my post because I had a typo, then you come in and say the same thing -____-
  11. Offline

    wklock

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Can you explain how that works please?
  12. Offline

    calebbfmv

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Lol anyway, basically it says: Use the type 44, then add the subtype of 6 Right? or f***ed up?
  13. Offline

    Timr

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

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

Share This Page