scoreboard players set r Random 8
function mctsts:util/random
tellraw @a ["",{"text":" |   ","color":"gray"},{"translate":"game.collect_powerup","color":"gray","with":[{"selector":"@s"},{"translate":"powerup.tier.4","color":"dark_purple","bold":true}]}]
execute if score n Random matches 1 run give @s golden_sword{Enchantments:[{id:"knockback",lvl:6}],HideFlags:63,display:{Name:'[{"translate":"powerup.1.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["IV"]}]'},Damage:32,powerup:1}
execute if score n Random matches 2 run function mctsts:game/items/extra_life
execute if score n Random matches 3 run give @s minecraft:diamond_boots{Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.5.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["III"]}]'},powerup:5}
execute if score n Random matches 4 run give @s minecraft:carrot_on_a_stick{Damage:7,Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.10.name","color":"white","bold":true,"italic":false}]'},powerup:10}
execute if score n Random matches 5 run give @s minecraft:carrot_on_a_stick{Damage:6,HideFlags:63,Unbreakable:1,display:{Name:'[{"translate":"powerup.8.name","color":"white","bold":true,"italic":false}," x5"]'},feather:5,powerup:8}
execute if score n Random matches 6 run give @s minecraft:carrot_on_a_stick{CustomModelData:1,Unbreakable:1,HideFlags:63,display:{Name:'[{"translate":"powerup.11.name","color":"white","bold":true,"italic":false}]'},powerup:11}
execute if score n Random matches 7 run give @s minecraft:netherite_sword{Damage:2030,Enchantments:[{id:"fire_aspect",lvl:1}],HideFlags:63,display:{Name:'[{"translate":"powerup.16.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["I"]}]'},powerup:16}
execute if score n Random matches 8 run give @s minecraft:diamond_chestplate{Damage:525,HideFlags:63,display:{Name:'[{"translate":"powerup.17.name","color":"white","bold":true,"italic":false}," - ",{"translate":"powerup.lvl","with":["II"]}]'},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
