Custom Items used in crafting.

Discussion in 'Plugin Development' started by hubeb, Jul 8, 2013.

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

    hubeb

    So, I have searched around only to have no luck in finding a solution. What I am trying to do is make a weapon. my recipe is as follows:

    Code:
    [T][S][ ]
    [T][ ][S]
    [T][S][ ] 
    Sturdy Bow Recipe:
    T = Custom string Called "Bow String"
    S = Custom stick Called "Bow Frame"

    I want to be able to craft the bow using the custom items. But I cannot for the life of me figure out how to do that.

    *I know how to make recipes (this one is obviously shaped), but I dont know how to make the recipe use my custom items.

    Any help would be appreciated.

    Thanks,
    Hubeb
     
  2. Offline

    Trevor1134

    hubeb Check if the items name == Bow String
     
  3. Offline

    ZeusAllMighty11

    You need to check in PrepareItemCraftEvent. Check each slot for the itemstack (make sure it's not null), and check if it has item meta, if so if it's X item meta (yours), then do stuff. (set result)
     
  4. Offline

    hubeb

    TheGreenGamerHD
    Do you mind showing me some generic example code? I cannot seem to get it working.
     
  5. Offline

    feaq16

  6. Offline

    hubeb

  7. Offline

    ZeusAllMighty11

    I already gave you the event, try playing around with it for a few hours.
     
  8. easy way:
    define itemstack with the item you want, lets say sticks.
    get meta data.
    set display name.
    set the meta data.

    in the recipe use the defined itemstack.
     
  9. Offline

    ZeusAllMighty11

  10. Offline

    Zach_1919

    mollekake In a recipe you can only use Materials, not ItemStacks.
     
  11. Ah. I thought i had already done that with my own plugin, but i was working on the same thing as this fella. Anyway, the PrepareItemCraftEvent is the right way to go. A bit tricky but i got it to work! Fun stuff!
     
Thread Status:
Not open for further replies.

Share This Page