
# -> Get count
execute store result score @s[type=item] OverlyRealistic.General.ArbitraryData run \
    data get entity @s Item.count
execute store result score @s[type=item_display] OverlyRealistic.General.ArbitraryData run \
    data get entity @s item.count

# -> If count is not higher than max then return and modify item
execute unless score @s OverlyRealistic.General.ArbitraryData matches 21.. run \
    return run \
        item modify entity @s contents overly_realistic:item_edit/special_item_edit/red_mushroom

# -> Set max stack
item modify entity @s contents overly_realistic:multipurpose/count_set/set_count_20

# -> Modify item
item modify entity @s contents overly_realistic:item_edit/special_item_edit/red_mushroom
