Custom items

Discussion in 'Spigot Plugin Development' started by coolnickname, May 5, 2015.

  1. Hello, I want to know how to make custom items, heard it's possible but I would like to know how. I found a tutorial, but it didn't work.
     
  2. Uh... you're gonna need to say a bit more.
     
    • Agree Agree x 1
  3. Custom recipes, custom abilities ?
     
  4. I need to make a custom item, with a crafting recipe and I need to call it from a listenerclass.
     
  5. Hmmm.. if you can give me some more information :S
     
  6. Like what?
     
  7. You can find everything you need on the Javadocs.
     
    • Optimistic Optimistic x 2
  8. Euh, you can't make a custom item with a new texture, name etc. What u can do is make a recipe for an existing item and make a texturepack for that item.
     
  9. Yeah, but why are these forums for ? Help. That's what he need, we are here to give it to him.
     
    • Agree Agree x 1
  10. I know, but this is way easier, and BTW: then this whole forum would be usless.
     
  11. I thougt I could make an item, with custom name and lore and stuff, but just no new texture.
     
  12. Yeah, create a custom recipe, make the item having a name and lore. Done.

    EDIT: Make a ItemStack with lore and name and set it as your recipe. That is how to set the name/lore.
     
  13. Awesome! Just back to my first question: how? Does someone has a tutorial? And to expand my question: how to make a resource pack for my item? I already know how to make a normal one.
     
  14. https://bukkit.org/threads/how-to-make-custom-crafting-recipes.301328/

    If you have a problem you should try googling it before posting.

    Write on Google, "bukkit <your problem>"

    This is not me being mean, but it will save you so much time.
     
  15. I said that in my edit mate.
    Code (Text):
    public void recipe(){
    ItemStack item = new ItemStack(Material.WOOD_SWORD);
    ItemMeta im = item.getItemMeta();
    im.setDisplayName("Your name");
    ArrayList<String> lore = new ArrayList<String>();
    lore.add("Your lore");
    im.setLore(lore);
    item.setItemMeta(im);

    //Then your recipe:

    ShapedRecipe sr = new ShapedRecipe(item);
    sr.shape("###");
    sr.setIngredient("#", Material.WOOD);

    //Last: set the recipe in your server

    Bukkit.getServer().addRecipe(sr);
    Then call the method in your onEnable and done. You can add more lines of shape , one line stands for 3 colums in your crafting table left to right.
     
  16. Thanks, but like you said you said what to do, not how. But now I know.

    I already did, but all I found was a not working tutorial. But thanks, that tutorial you gave might work!
     
    • Friendly Friendly x 1
  17. @Svenna Thanks, it worked perfect! But... do you also know how to make a resource pack to give it another texture?
     
  18. No probs :) glad to help! Euhm. I dunno, maybe you can watch a video from youtube.
     
  19. Youtube: