Why my custom enchants doesnt stack?

Discussion in 'Plugin Development' started by 9Ebisu, Sep 17, 2022.

  1. Offline

    9Ebisu

    yo, i faced with the problem when writing a plugin for my server. My custom enchants from this plugin doenst stack... It's look like they just replace each other
    There is example how i adding the enchantment... Maybe i'm doing something wrong?
    ver.: 1.16.5
    Code:
        public static void customEnchantment_Undroppable(Player player, ItemStack item, ItemMeta meta, List<String> lore, String lvl) {
            item.addUnsafeEnchantment(CE_Main.enchantment_undroppable, 1);
            meta.addEnchant(CE_Main.enchantment_undroppable, 1, true);
            lore.add("Undroppable");
            meta.setLore(lore);
            item.setItemMeta(meta);
        }
    
        public static void customEnchantment_DrivenByTheWind(Player player, ItemStack item, ItemMeta meta, List<String> lore, String lvl) {
            item.addUnsafeEnchantment(CE_Main.enchantment_drivenByTheWind, 1);
            meta.addEnchant(CE_Main.enchantment_drivenByTheWind, 1, true);
            lore.add("Driven by the wind I");
            meta.setLore(lore);
            item.setItemMeta(meta);
        }
     
  2. Offline

    CraftCreeper6

  3. Offline

    9Ebisu

    @CraftCreeper6 it looks like enchants stacking, but lore - not. IDK, mb my way to add lore is wrong? How it work: I can add lore from 1 enchantment, but when i'll try to add another enchantment lore dont showing on item about 2nd ecnhantment.
     
  4. Offline

    CraftCreeper6

    Can I see how you call each method?
     

Share This Page