Solved Crafting recipes returning multiple items

Discussion in 'Plugin Development' started by MinecraftMart, Aug 1, 2014.

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

    MinecraftMart

    So i have a costum item and a costum crafting recipe. But i want the crafting recipe to return more of that item at once. Just like the arrow recipe.

    But i cant set the itemstack to 6 items because i need to extract them at some point using .removeItem. it seems it extracts all 6 of them.

    Is there a way to do it in the crafting recipe? or another way?

    -Mart
     
  2. Offline

    TheMcScavenger

    What do you mean with "it seems it extracts all 6 of them"? If you're trying to remove a single item from a stack, you shouldn't change the stack (e.g. setting it to null), but the amount in the stack.

    Code:java
    1. ItemStack stack;
    2.  
    3. stack.setAmount(stack.getAmount() - 1);

    http://jd.bukkit.org/rb/apidocs/org/bukkit/inventory/ItemStack.html
     
  3. Offline

    MinecraftMart

    TheMcScavenger likes this.
Thread Status:
Not open for further replies.

Share This Page