data modify entity @s Item.tag.nl_Has_Slot1_Enchantment set value 1b
# alchemist #
execute as @s[scores={nl.Rng=1..5}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/alchemist
# autosmelt #
execute as @s[scores={nl.Rng=0..10}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/autosmelt
# bleed #
execute as @s[scores={nl.Rng=5..15}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/bleed
# Detector #
execute as @s[scores={nl.Rng=15..35}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/detector
# Double Jump #
execute as @s[scores={nl.Rng=20..40}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/double_jump
# Gemology #
execute as @s[scores={nl.Rng=25..50}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/gemology
# Haste Burst #
execute as @s[scores={nl.Rng=30..55}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/haste_burst
# Infect #
execute as @s[scores={nl.Rng=35..65}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/infect
# Leech Life #
execute as @s[scores={nl.Rng=40..70}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/leech_life
# scan #
execute as @s[scores={nl.Rng=45..80}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/scan
# Sifter #
execute as @s[scores={nl.Rng=50..85}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/sifter
# slow falling #
execute as @s[scores={nl.Rng=55..90}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/slowfall
# Soul Burst#
execute as @s[scores={nl.Rng=60..95}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/soul_burst
# Stun #
execute as @s[scores={nl.Rng=65..100}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/stun
# tree lopper #
execute as @s[scores={nl.Rng=75..79}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/tree_lopper
# veinminer #
execute as @s[scores={nl.Rng=80..84}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/veinminer

# Damage Charm #
execute as @s[scores={nl.Rng=85..86}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/damage_charm
# Speed charm #
execute as @s[scores={nl.Rng=87..88}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/speed_charm


# yellow wings #
execute as @s[scores={nl.Rng=89}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/yellow_wings
# blue wings #
execute as @s[scores={nl.Rng=90}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/blue_wings
# red wings #
execute as @s[scores={nl.Rng=91}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/red_wings
# green wings #
execute as @s[scores={nl.Rng=92}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/green_wings

# Ice Trail #
execute as @s[scores={nl.Rng=93..94}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/ice_trail
# Fire Trail #
execute as @s[scores={nl.Rng=95..96}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/fire_trail
# Forest Trail #
execute as @s[scores={nl.Rng=97..98}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/forest_trail
# Magic Trail #
execute as @s[scores={nl.Rng=99..100}] run function next_level:custom_blocks/emerald_enchanter/enchant_slot1/custom_enchantments/magic_trail


execute as @e[tag=nl_Enchanter,limit=1,sort=nearest,distance=..7] at @s run function next_level:custom_blocks/emerald_enchanter/remove_emerald
execute at @s run playsound minecraft:entity.experience_orb.pickup voice @a[distance=..10] ~ ~ ~ 1 1
execute at @s run xp add @p[level=10..] -10 levels 
