Ender Pearl Limit?
Hello, I'm relatively advanced in datapacks, like load.json and tick.json as well as basic .mcfunction files, but I'm really stuck cos I'm a creating a datapack for my friend, I've done most of it like stonecutters damage, player health indicators and no netherite tools & armor in the smithing table. But there is one thing I'm stuck with, which is limit pearls players can have in their inventory. Can someone help me or explain to me how would i make something that checks for pearls in players inventorys and if their is any more than 16 pearls, clear the rest of them (So X (Total pearls) - Y (Amount of pearls you'd have to clear to get to 16 pearls) = 16 (The amount of pearls your allowed to have). Thx so much for your help guys and I'm glad I've joined what appears to be a really helpful community! :)