tag @s remove EtherItems
tag @s remove KyuHarmPot
tag @s remove KyuHarmPot2
tag @s remove KyuHarmSpl
tag @s remove KyuHarmSpl2
tag @s remove KyuP4Book
tag @s remove KyuP5Book


execute as @s[nbt={Inventory:[{id:"minecraft:crossbow"}]},scores={health=5..}] run tag @s add EtherItems


#execute as @s[nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:potion",tag:{Potion:"minecraft:harming"}}]},scores={health=5..}] run tag @s add EtherItems
#execute as @s[nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:potion",tag:{Potion:"minecraft:harming"}}]},scores={health=5..}] run tag @s add KyuHarmPot
#
#execute as @s[tag=!EtherItems,nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:potion",tag:{Potion:"minecraft:strong_harming"}}]},scores={health=5..}] run tag @s add KyuHarmPot2
#execute as @s[tag=!EtherItems,nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:potion",tag:{Potion:"minecraft:strong_harming"}}]},scores={health=5..}] run tag @s add EtherItems
#
#execute as @s[tag=!EtherItems,nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:splash_potion",tag:{Potion:"minecraft:harming"}}]},scores={health=5..}] run tag @s add KyuHarmSpl
#execute as @s[tag=!EtherItems,nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:splash_potion",tag:{Potion:"minecraft:harming"}}]},scores={health=5..}] run tag @s add EtherItems
#
#execute as @s[tag=!EtherItems,nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:splash_potion",tag:{Potion:"minecraft:strong_harming"}}]},scores={health=5..}] run tag @s add KyuHarmSpl2
#execute as @s[tag=!EtherItems,nbt={Inventory:[{id:"minecraft:crossbow"}]},nbt={Inventory:[{id:"minecraft:splash_potion",tag:{Potion:"minecraft:strong_harming"}}]},scores={health=5..}] run tag @s add EtherItems

#execute as @s[tag=EtherItems,nbt={Inventory:[{id:"minecraft:enchanted_book",tag:{StoredEnchantments:[{id:"minecraft:power",lvl:4s}]}}]},scores={health=5..}] run tag @s add KyuP4Book
#execute as @s[tag=EtherItems,tag=!KyuP4Book,nbt={Inventory:[{id:"minecraft:enchanted_book",tag:{StoredEnchantments:[{id:"minecraft:power",lvl:5s}]}}]},scores={health=5..}] run tag @s add KyuP5Book

#tag @s[tag=EtherItems,tag=!KyuP4Book,tag=!KyuP5Book] remove EtherItems


clear @s[tag=EtherItems] crossbow 1
#clear @s[tag=EtherItems,tag=KyuP4Book] enchanted_book{StoredEnchantments:[{id:"minecraft:power",lvl:4s}]} 1
#clear @s[tag=EtherItems,tag=KyuP5Book] enchanted_book{StoredEnchantments:[{id:"minecraft:power",lvl:5s}]} 1
#clear @s[tag=EtherItems,tag=KyuHarmPot] potion{Potion:"minecraft:harming"} 1
#clear @s[tag=EtherItems,tag=KyuHarmPot2] potion{Potion:"minecraft:strong_harming"} 1
#clear @s[tag=EtherItems,tag=KyuHarmSpl] splash_potion{Potion:"minecraft:harming"} 1
#clear @s[tag=EtherItems,tag=KyuHarmSpl2] splash_potion{Potion:"minecraft:strong_harming"} 1

#do void damage
tag @s[tag=EtherItems] add DoVoid

execute at @s[tag=EtherItems] run loot spawn ~ ~ ~ loot minecraft:customitems/etheriumbloodbolt
execute as @s[tag=EtherItems] run scoreboard players set @s KyuVoid -10
execute if entity @s[tag=EtherItems] run function zzzzdonotuse:misc/activatevoiddamage
#give @s[tag=EtherItems] minecraft:crossbow{display:{Name:'{"text":"The Etherium Blood-Bolt"}',Lore:["\"A crossbow that saps your health to fire\"","\"a magical bolt that ignores enemy armor and cripples them,\"","\"lowering their armor/speed/damage for a few seconds.\""]},bloodbolt:1b,Enchantments:[{id:"minecraft:unbreaking",lvl:3s},{id:"minecraft:quick_charge",lvl:2s}]} 1

tag @s remove EtherItems
tag @s remove KyuHarmPot
tag @s remove KyuHarmPot2
tag @s remove KyuHarmSpl
tag @s remove KyuHarmSpl2
tag @s remove KyuP4Book
tag @s remove KyuP5Book







#tellraw @a[tag=!ImbueSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Blood Imbue spell! It is located on page 43 of your spellbook.","color":"dark_aqua"}]
#tag @a[tag=!ImbueSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add ImbueSpell
#clear @a[tag=ImbueSpell,tag=!ImbueSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
#tag @a[tag=ImbueSpell,tag=!ImbueSpell2] add ImbueSpell2
#
#tellraw @a[tag=!RageSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Blind Rage spell! It is located on page 44 of your spellbook.","color":"dark_aqua"}]
#tag @a[tag=!RageSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add RageSpell
#clear @a[tag=RageSpell,tag=!RageSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
#tag @a[tag=RageSpell,tag=!RageSpell2] add RageSpell2
#
#tellraw @a[tag=!BasicRevSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Basic Revive spell! It is located on page 32 of your spellbook.","color":"dark_aqua"}]
#tag @a[tag=!BasicRevSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add BasicRevSpell
#clear @a[tag=BasicRevSpell,tag=!BasicRevSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:unbreaking",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
#tag @a[tag=BasicRevSpell,tag=!BasicRevSpell2] add BasicRevSpell2
#