Since the new 1.20.5/6, mojang now use Components to store Item properties.
ItemFlag enum does not work as before.
Plugin to reproduce: https://github.com/GrayR0ot/spigot-item-flags-bug
Example:
I create an ItemStack using spigot API:
ItemStack{COBBLESTONE x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"text":"Pierre","italic":false,"color":"white"}, lore=[{"text":"Ressource minière","italic":false,"color":"dark_gray"}, {"text":"Description en cours de rédaction","italic":false,"color":"white"}, "", {"text":"COMMUN","italic":false,"color":"white","bold":true}], ItemFlags=[HIDE_ENCHANTS, HIDE_ATTRIBUTES, HIDE_UNBREAKABLE, HIDE_DESTROYS, HIDE_PLACED_ON, HIDE_ADDITIONAL_TOOLTIP, HIDE_DYE, HIDE_ARMOR_TRIM, HIDE_STORED_ENCHANTS], PublicBukkitValues={ "shfarmrun:id": "060f381e-f76f-4f5e-84a1-e1b0c82b961b" }}}
Now, when I give it to a player, here is what the player have in it's inventory:
ItemStack{COBBLESTONE x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"text":"Pierre","italic":false,"color":"white"}, lore=[{"text":"Ressource minière","italic":false,"color":"dark_gray"}, {"text":"Description en cours de rédaction","italic":false,"color":"white"}, "", {"text":"COMMUN","italic":false,"color":"white","bold":true}], ItemFlags=[HIDE_ADDITIONAL_TOOLTIP], PublicBukkitValues={ "shfarmrun:id": "060f381e-f76f-4f5e-84a1-e1b0c82b961b" }}}
We can see, everything looks the same, but no, the ItemFlags property has been changed.