clear @s minecraft:barrel[minecraft:custom_data~{box:1}]
give @s barrel[max_stack_size=1,custom_name='{"italic":false,"translate":"loader.box"}',custom_data={box:1}] 1
scoreboard players reset @s pickup