data remove storage player_data 1.shotgun
execute store result storage player_data 1.shotgun.x int 1 run random value -10..10
execute store result storage player_data 1.shotgun.y int 1 run random value -10..10

# execute as @s[tag=upgrade_1] store result storage player_data 1.shotgun.x int 1 run random value -10..10
# execute as @s[tag=upgrade_1] store result storage player_data 1.shotgun.y int 1 run random value -10..10

data modify storage player_data 1.shotgun.distance set value 100

data modify storage player_data 1.shotgun.id set value "id1"

function main:characters/engineer/weapon/id1/shotgun with storage player_data 1.shotgun