Why is it not working?

scoreboard players remove @s[tag=shoot] ammo_stats 1

execute at @s[tag=shoot] run summon chest_minecart ~ ~ ~ {Tags:[ammo_copy]}

execute at @s[tag=shoot] run item replace entity @e[sort=nearest,tag=ammo_copy] container.0 from entity @s[tag=shoot] weapon.mainhand

execute store result entity @e[type=chest_minecart,sort=nearest,limit=1,tag=ammo_copy] Items[0].nbt.ammo double 1 run scoreboard players get @s[tag=shoot] ammo_stats

item replace entity @s[tag=shoot] weapon.mainhand from entity @e[type=chest_minecart,sort=nearest,limit=1,tag=ammo_copy] container.0

execute as @s[tag=shoot] run say test

execute if entity @s[tag=shoot] run function gun:shoot/start

(item in chest_minecart still has the same ammo) 😦

Continue to help post