#10,000

# roll # 
loot spawn ~ ~ ~ loot next_level:custom_blocks/enchant_roll
execute store result score @s nl.Rng at @s run data get entity @e[type=minecraft:item,distance=..1,limit=1,nbt={Item:{tag:{nl_roll100:1b}}}] Item.tag.AttributeModifiers.[0].Amount
kill @e[limit=1,nbt={Item:{tag:{nl_roll100:1b}}}]

    # 51-90 rested #

execute as @s[scores={nl.Rng=51..90}] run effect give @s minecraft:instant_health 
execute as @s[scores={nl.Rng=51..90}] run tellraw @s ["",{"text":"[minecraft:next_level]: ","color":"gold"},{"text":"Rested Bonus","color":"dark_aqua","hoverEvent":{"action":"show_text","value":[{"text":"Rested Bonus Applied: ","color":"gray"},{"text":"\n"},[{"text":"+4 HP Restored!","color":"dark_green"},{"text":" [","color":"gray"},{"text":"❤❤","color":"red"},{"text":"]","color":"gray"}]]}},{"text":" has been applied!","color":"dark_green"},{"text":"\n "}]

    # 91-100 Well rested # 
execute as @s[scores={nl.Rng=91..100}] run effect give @s minecraft:instant_health 1 1
execute as @s[scores={nl.Rng=91..100}] run tellraw @s ["",{"text":"[minecraft:next_level]: ","color":"gold"},{"text":"Well Rested Bonus","color":"dark_aqua","hoverEvent":{"action":"show_text","value":[{"text":"Well Rested Bonus Applied: ","color":"gray"},{"text":"\n"},[{"text":"+8 HP Restored!","color":"dark_green"},{"text":" [","color":"gray"},{"text":"❤❤❤❤","color":"red"},{"text":"]","color":"gray"}]]}},{"text":" has been applied!","color":"dark_green"},{"text":"\n "}]

scoreboard players set @s nl.RestTimer 10000
scoreboard players set @s nl.WellRested 0 
tag @s add nl_Rested
