Removing custom data component from an item while respecting the stack count
I was trying to make it so that players with a specific tag can eat golden apples faster. I was doing so by running an item modifier like so:
Continue to help postexecute if items entity @s weapon.mainhand minecraft:golden_apple run item modify entity @s weapon.mainhand ssiege:make_fast
which works great, and respects item count. However, I'm not sure how to turn these back into regular golden apples.
I was using
execute if items entity @s weapon.mainhand minecraft:golden_apple run item modify entity @s weapon.mainhand {function:"minecraft:set_components",components:{"minecraft:consumable":{},"minecraft:custom_data":{}}}
, but this creates golden apples with an empty custom data component, which are no longer stackable with normal gapples.
I alternatively tried item replace instead of item modify but that didn't seem to respect the stack count (set to 1 golden apple)