Problem with item meta

Discussion in 'Plugin Development' started by Pixyde, Aug 25, 2021.

  1. Offline


    Hi, I have been programming a plugin for a few days and I encountered a problem with item meta doing weird things.
       ItemStack chainpants = new ItemStack(Material.CHAINMAIL_LEGGINGS);{
            ItemMeta chainpantsM = chainpants.getItemMeta();
                chainpantsM.setDisplayName("Pantalon suivant");
                chainpantsM.setLore(Arrays.asList("Prix : 20 diamants", "Cliquer pour acheter"));
        ItemStack chainboots = new ItemStack(Material.CHAINMAIL_BOOTS);{
            ItemMeta chainbootsM = chainboots.getItemMeta();
                chainbootsM.setDisplayName("Bottes suivante");
                chainbootsM.setLore(Arrays.asList("Prix : 20 diamants", "Cliquer pour acheter"));
    i have these two item, and it seems like the pants is sharing is itemmeta withe the boots.
    The pants look normal :
    but the boots get the meta of the pants :

    I have no idea why it do this because I have 20 other items that I coded the same way and they all work.
    If you have any idea of what I did wrong please share it with me.
  2. Offline


    Can you share more code please? This isn't enough to figure out what' s the problem. Also, why did you put brackets when it's not a statement?

Share This Page