AttributeStorage icon indicating copy to clipboard operation
AttributeStorage copied to clipboard

(Better) support for 1.9?

Open Mrtenz opened this issue 9 years ago • 6 comments

This is what shows up in 1.9: 1.9

I know that this project is pretty old, but it would be great if this could be fixed.

Mrtenz avatar Apr 05 '16 18:04 Mrtenz

I have made a fix for that (probably bad code), if you want I can send you.

Flawd avatar Apr 23 '16 17:04 Flawd

That would be great.

Mrtenz avatar Apr 24 '16 17:04 Mrtenz

http://pastebin.com/8xHHVgfX

and this is a code example of how im using it

public static ItemStack armorModify(ItemStack stack, String slot)
    {
        Attributes ab = new Attributes(stack, slot);
        ab.add(Attribute.newBuilder().name("Armor").type(AttributeType.GENERIC_ARMOR).amount(30).build());
        ItemStack stack2 = ab.getStack();
        return stack2;
    }

dont know if you can still apply it to all slots

Flawd avatar Apr 28 '16 21:04 Flawd

@Flawd could you reupload your code? Pastebin says the paste has expired :(

MrPowerGamerBR avatar Jun 25 '16 18:06 MrPowerGamerBR

I dont have it anymore, sorry. Just use this, it's better: https://www.spigotmc.org/resources/item-attribute-modifier-api-library.22747/

Flawd avatar Jun 26 '16 12:06 Flawd

Okay I finally found a solution for that bug.

    ItemMeta meta = newItem.getItemMeta();
    meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);

That's it.

MrPowerGamerBR avatar Oct 27 '16 11:10 MrPowerGamerBR