Remove Minecraft Item Info?

le
- in Plugins
14

I'm currently programming a small plugin where I work with items and I would like to remove the item info

Here is a picture of what I mean:

Thank you for all questions that have nothing to do with "Google Yes" or a look in the docs.

Po

You can deactivate and activate the Minecraft Item Info with F3-H

le

Unfortunately, this was not what I wanted, but thank you for your efforts.

Po

What did you mean, maybe can I help you there?

le

As I said, I want to create certain items with a plugin and remove this information from them.

an

The gray item info (i.e. Item name and possibly number of NBT tags) can't be removed.

The blue attribute information, on the other hand, can be hidden as follows:

ItemStack i = new ItemStack (Material.IRON_SWORD);
ItemMeta i'm = i.getItemMeta ();
i'm.addItemFlags (ItemFlag.HIDE_ATTRIBUTES);
i.setItemMeta (i'm);

le

Hypixel somehow did it. Okay, I thank you for your help anyway.

an

I doubt it. I'll have a look.

So the blue can be removed. But the gray text, ie the "minecraft: iron_sword", can't normally be removed.

le

Okay, so what exactly do you set to 0?

an

I was right, Hypixel can't get rid of the gray text either:

https://hypixel.net/attachments/upload_2019-10-11_17-30-37-png.1358170/

You can get rid of the blue by hiding attributes. Goes so:

ItemStack i = new ItemStack (Material.IRON_SWORD);
ItemMeta i'm = i.getItemMeta ();
i'm.addItemFlags (ItemFlag.HIDE_ATTRIBUTES);
i.setItemMeta (i'm);

le

Ahh, ItemFlags thank you with all my heart.

an

There you go ^^

As a plugin developer, it's always very useful to be able to google (shouldn't be a front xD). For almost everything there's already a solution on spigotmc. If you had entered "spigot item remove attack damage" on Google, you would have found the solution.

le

I probably won't think of something like that haha but I'll remember it for the night ^^

an

Googling is an art in itself. But practice makes perfect xD

le

"Anyone who can google has a clear advantage" xD