Minecraft indestructible item by own crafting recipe?

Ba
6

I would like to indestructible the item that comes out after crafting. Maybe someone can write me a small sample code.

Here is a part of the code:

Li

Just catch up on all events where the item in question could be damaged, and then check the item name, for example. If the item name from the event then coincides with the item which is to be indestructible, you can enter there in the event e.g. Prevent the item from taking damage.

Ba

Unfortunately does not help me.

Lo

If you think that the Durability does not go down:

item.spigot () setUnbreakable (true).
or
meta.spigot () setUnbreakable (true).

if so meant as bedrock

@EventHandler
public void onBlockBreak (BlockBreakEvent e) {
// cancel here if item is
}

Ba

Many Thanks!

Lo

It's a pleasure

Th

After a little 5-minute search, I found the following:

meta.spigot () setUnbreakable (true).

What is this message? St StephanieItchy
Indestructible tools? Lu LuisBrayan
Minecraft goal? St StatementVinyl