How do I make items give you attributes when they are in the inventory? It only works when the player holds the item or wears it, but not when the item is in the inventory.
Attributes are only applied when the item is "active", meaning it is in any of the following slots:
- helmet slot
- chestplate slot
- leggings slot
- boots slot
- offhand slot
- selected hotbar slot
And even there they have to be the item itself, not its content (for example an item which gives attributes doesn't work if you hold a shulker box containing it).