scoreboard players set r Random 8
function mctsts:util/random
execute if score n Random matches 1 run give @s wooden_sword{Enchantments:[{id:"knockback",lvl:2}],HideFlags:63,display:{Name:'[{"translate":"powerup.1.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["II"]}]'},Damage:59,powerup:1}
execute if score n Random matches 2 run give @s snowball{Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.3.name","color":"white","bold":true,"italic":false}]'},powerup:3}
execute if score n Random matches 3 run give @s egg{Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.2.name","color":"white","bold":true,"italic":false}]'},powerup:2} 5
execute if score n Random matches 4 run give @s minecraft:carrot_on_a_stick{Damage:2,Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.4.name","color":"white","bold":true,"italic":false}," x1"]'},powerup:4}
execute if score n Random matches 5 run give @s minecraft:leather_boots{Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.5.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["I"]}]'},powerup:5}
execute if score n Random matches 6 run give @s minecraft:carrot_on_a_stick{CustomModelData:3,Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.14.name","color":"white","bold":true,"italic":false}]'},powerup:14}
execute if score n Random matches 7 run give @s minecraft:lingering_potion{Potion:"strong_poison",display:{Name:'[{"translate":"powerup.15.name","color":"white","bold":true,"italic":false}]'},powerup:15}
execute if score n Random matches 8 run give @s minecraft:golden_chestplate{Damage:111,HideFlags:63,display:{Name:'[{"translate":"powerup.17.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["I"]}]'},AttributeModifiers:[{AttributeName:"generic.knockback_resistance",Name:"generic.knockback_resistance",Amount:1000,Operation:0,UUID:[I;1691954058,-2022881330,-1458623820,-668990075]}],powerup:17}
scoreboard players set n Random 0
tellraw @a ["",{"text":" |   ","color":"gray"},{"translate":"game.collect_powerup","color":"gray","with":[{"selector":"@s"},{"translate":"powerup.tier.2","color":"green","bold":true}]}]