Solved Unique Repair Recipe

Discussion in 'Plugin Development' started by noraver, Mar 31, 2013.

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

    noraver

    was wondering if anyone had this or know a idea how to make it

    Repair Recipe (does not need to repair and not replace item) item need to have the right display name so if hasDisplayName("test item") is place into craftblock with lets say Material.DIAMOND
    it will setLore('abc") on the item

    any examples on how to do this would be wonderful
     
  2. Offline

    chasechocolate

    Code:java
    1. ItemStack item = new ItemStack(Material.DIAMOND);
    2. ItemMeta meta = item.getItemMeta();
    3. meta.setDisplayName("whatever");
    4. ArrayList<String> description = new ArrayList<String>();
    5. description.add("I'm a description...");
    6. meta.setLore(description);
    7. item.setItemMeta(meta);
    8. player.getInventory().addItem(item);
     
  3. Offline

    noraver

Thread Status:
Not open for further replies.

Share This Page