Adding ItemFlags to GUI items is possible, but they don’t work in-game (tested in 1.21.3+, maybe even lower versions).
To make them work properly, you need to add empty AttributeModifiers to the ItemMeta, for example:
meta.setAttributeModifiers(MultimapBuilder.hashKeys().hashSetValues().build());
Without this, item flags are visually added but have no real effect in-game.
Adding ItemFlags to GUI items is possible, but they don’t work in-game (tested in 1.21.3+, maybe even lower versions).
To make them work properly, you need to add empty AttributeModifiers to the ItemMeta, for example:
meta.setAttributeModifiers(MultimapBuilder.hashKeys().hashSetValues().build());Without this, item flags are visually added but have no real effect in-game.