Basically what i'm trying to do is to check for food items to see if they have the following tag "spoiled:SpoilTimer", and if it checks as true then it'll add another tag to it, that adds a custom model data to that item. Like so:
ServerEvents.tick('minecraft:bread', event => {
event.modify('minecraft:bread', item => {
// Check if the item is food and has the "SpoilTime" tag
if (item.isFood() && item.hasTag('spoiled:SpoilTimer')) {
// Add CustomModelData tag to the item
item.customModelData = 12345;
}
});
});