How to add prefix to the item after crafting it?

Discussion in 'Plugin Development' started by N_Wave, Feb 10, 2024.

  1. Offline

    N_Wave

    I want to make plugin, which adds modificator to items name (like "Legendary Diamond Sword")
    I got CraftItemEvent, but which method I should use for changing ItemMeta of crafted item? I tried some solutions, but I keep recieving items with its default names from crafting table. Can someone help?
     
  2. Offline

    KarimAKL

    @N_Wave According to the Javadoc, the CraftItemEvent is called when the items are added to the crafting matrix, not when the item has been crafted. Unfortunately, it seems you have to listen for the InventoryClickEvent and check if the item has been taken from the result slot. You will have to check for both the crafting inventory (3x3) and the player inventory (2x2).
     

Share This Page