function main:mechanics/upgrades/choose_upgrade
execute store result storage mechanics upgrade_1.id int 1 run scoreboard players get .upgrade mechanics
$data modify storage mechanics upgrade_1.character set value $(character)
$data modify storage mechanics upgrade_1.player_id set value $(player_id)
data modify storage mechanics upgrade_1.number set value 1
function main:mechanics/upgrades/blank with storage mechanics upgrade_1
function main:mechanics/upgrades/grant with storage mechanics upgrade_1

function main:mechanics/upgrades/choose_upgrade
execute store result storage mechanics upgrade_2.id int 1 run scoreboard players get .upgrade mechanics
$data modify storage mechanics upgrade_2.character set value $(character)
$data modify storage mechanics upgrade_2.player_id set value $(player_id)
data modify storage mechanics upgrade_2.number set value 2

function main:mechanics/upgrades/blank with storage mechanics upgrade_2
function main:mechanics/upgrades/grant with storage mechanics upgrade_2

function main:mechanics/upgrades/give_book with storage player_data 1.upgrades