general help about datapacks
i'm a bit newer to data packs and would like some help.
one of the main things i would like help with is understanding how to use predicates and maybe also item modifiers.
i would also like understanding how to optimize lag from my commands through my data pack, i usually use a ton of command blocks a lot in creating maps/worlds for my friends, im only recently learning datapacks to help expand what i can do.
the main thing im trying to do (and this can probably wait until i learn a bit about predicates and maybe item modifiers if its needed for what i plan on doing) is first detecting if somebody is holding a item, this item is called a task paper and it has a bit of specialized nbt data such as the name and color of it's name and it's custom data which is tasks:taskpaper. when it is detected it gets deleted and randomly replace with 1 of 10 items, which is task1-task10 (custom data (tasks:task1)-(tasks:task10)) so far those are what i have completed but the next parts are a bit more specific. when somebody gets detected with a task1 paper when it's in inventory slots 15, 16, or 17 (the top right corner of the inventory) it gets locked in place there and it's lore will auto update from a scoreboard. that should be all i need to get for now, ill continue it after i get to there, but maybe also know if i can uniquely identify every task1 item in a person's inventory, so if they already have a way to identify all of them separately i would like to know weather i use it for this or not, if its not already a thing maybe to know how to automatically assign a randomized value that cannot be the same as another value of that type to every one of that specific item you get and store it in a command that can be retrieved from some type of event as a test to see if its one of those items
the last 2 paragraphs above this may have been a bit longer than i expected, mainly i just want answers about the questions at the top of this message. basic information would be useful.