item replace entity @s container.0 from entity @p[advancements={colosseum_of_fools:item/cog_crossbow=true}] weapon.mainhand
data modify entity @s item.components."minecraft:charged_projectiles" set value [{id:"arrow"}]
data modify entity @s item.components."minecraft:charged_projectiles"[0] set from entity @n[distance=..0.5,type=#arrows] item
data modify entity @s item.components."minecraft:charged_projectiles"[0] set from entity @n[distance=..0.5,type=spectral_arrow] item
data modify entity @s item.components."minecraft:charged_projectiles"[0] set from entity @n[distance=..0.5,type=firework_rocket] FireworksItem
execute if items entity @s container.0 *[custom_data={colosseum_of_fools:{item:cog_crossbow,arrow_count:1b}}] run data remove entity @s item.components."minecraft:charged_projectiles"[0]
execute if items entity @s container.0 *[custom_data={colosseum_of_fools:{item:cog_crossbow,arrow_count:1b}}] run data modify entity @s item.components."minecraft:custom_data"."colosseum_of_fools"{item:cog_crossbow,arrow_count:1b}.arrow_count set value 6b
data modify entity @s item.components."minecraft:custom_data"."colosseum_of_fools"{item:cog_crossbow,arrow_count:2b}.arrow_count set value 1b
data modify entity @s item.components."minecraft:custom_data"."colosseum_of_fools"{item:cog_crossbow,arrow_count:3b}.arrow_count set value 2b
data modify entity @s item.components."minecraft:custom_data"."colosseum_of_fools"{item:cog_crossbow,arrow_count:4b}.arrow_count set value 3b
data modify entity @s item.components."minecraft:custom_data"."colosseum_of_fools"{item:cog_crossbow,arrow_count:5b}.arrow_count set value 4b
data modify entity @s item.components."minecraft:custom_data"."colosseum_of_fools"{item:cog_crossbow,arrow_count:6b}.arrow_count set value 5b
item replace entity @p[advancements={colosseum_of_fools:item/cog_crossbow=true}] weapon.mainhand from entity @s container.0
kill @s