tag @s add SpellUpdate


tellraw @s[tag=!GlassGen,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:1s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Glass Generator spell! It is located on page 6 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!GlassGen,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:1s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add GlassGen
clear @s[tag=GlassGen,tag=!GlassGen2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:1s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:1s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=GlassGen,tag=!GlassGen2] add GlassGen2
tellraw @s[tag=!HasteSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:2s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Haste spell! It is located on page 7 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!HasteSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:2s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add HasteSpell
clear @s[tag=HasteSpell,tag=!HasteSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:2s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:2s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=HasteSpell,tag=!HasteSpell2] add HasteSpell2
tellraw @s[tag=!SlowFallSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:3s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Slowfall spell! It is located on page 8 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!SlowFallSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:3s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add SlowFallSpell
clear @s[tag=SlowFallSpell,tag=!SlowFallSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:3s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:3s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=SlowFallSpell,tag=!SlowFallSpell2] add SlowFallSpell2
tellraw @s[tag=!ResistSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:4s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Resist spell! It is located on page 9 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!ResistSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:4s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add ResistSpell
clear @s[tag=ResistSpell,tag=!ResistSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:4s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:4s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=ResistSpell,tag=!ResistSpell2] add ResistSpell2
tellraw @s[tag=!EscapeSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:5s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Escape spell! It is located on page 10 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!EscapeSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:5s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add EscapeSpell
clear @s[tag=EscapeSpell,tag=!EscapeSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:5s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:5s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=EscapeSpell,tag=!EscapeSpell2] add EscapeSpell2
tellraw @s[tag=!LocateSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:6s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Enchanted Cavern Locator spell! It is located on page 11 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!LocateSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:6s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add LocateSpell
clear @s[tag=LocateSpell,tag=!LocateSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:6s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:6s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=LocateSpell,tag=!LocateSpell2] add LocateSpell2
tellraw @s[tag=!HorseSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Spooky Horse spell! It is located on page 12 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!HorseSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add HorseSpell
clear @s[tag=HorseSpell,tag=!HorseSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:7s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=HorseSpell,tag=!HorseSpell2] add HorseSpell2
#
tellraw @s[tag=!WeatherSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Clear Weather spell! It is located on page 13 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!WeatherSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add WeatherSpell
tag @s[tag=WeatherSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add WeatherSpellAdd
execute at @s[tag=K,tag=WeatherSpellAdd] run tag @s[tag=K,tag=!WeatherSpell2] add WeatherSpell
clear @s[tag=WeatherSpell,tag=!WeatherSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=WeatherSpell,tag=!WeatherSpell2] add WeatherSpell2
#
tellraw @s[tag=!InvisSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Invisibility spell! It is located on page 14 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!InvisSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add InvisSpell
clear @s[tag=InvisSpell,tag=!InvisSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:9s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=InvisSpell,tag=!InvisSpell2] add InvisSpell2
tellraw @s[tag=!PortalSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:10s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Create Portal spell! It is located on page 15 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!PortalSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:10s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add PortalSpell
clear @s[tag=PortalSpell,tag=!PortalSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:10s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:10s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=PortalSpell,tag=!PortalSpell2] add PortalSpell2
tellraw @s[tag=!AnimalSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:11s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Farm Animal Capture spell! It is located on page 16 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!AnimalSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:11s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add AnimalSpell
clear @s[tag=AnimalSpell,tag=!AnimalSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:11s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:11s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=AnimalSpell,tag=!AnimalSpell2] add AnimalSpell2
#
tellraw @s[nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"As you have already unlocked the Clear Weather spell, the page is consumed and an extra charge has been added.","color":"dark_aqua"}]
execute at @s[tag=K,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] run scoreboard players add @e[name=DayQ] WeatherSpell 1
clear @s[nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:8s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tellraw @s[tag=!CobbleSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:29s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Cobble Gen spell! It is located on page 5 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!CobbleSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:29s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add CobbleSpell
clear @s[tag=CobbleSpell,tag=!CobbleSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:29s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:29s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=CobbleSpell,tag=!CobbleSpell2] add CobbleSpell2
#
tellraw @s[tag=!ExpSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:30s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] ["",{"text":"You have unlocked the Exp To Bottles spell! It is located on page 17 of your spellbook.","color":"dark_aqua"}]
tag @s[tag=!ExpSpell,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:30s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] add ExpSpell
clear @s[tag=ExpSpell,tag=!ExpSpell2,nbt={SelectedItem:{tag:{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:30s}],display:{Lore:["\"Unlocks a spell when held.\""]}}}}] paper{HideFlags:1,Enchantments:[{id:"minecraft:lure",lvl:30s}],display:{Lore:["\"Unlocks a spell when held.\""]}} 1
tag @s[tag=ExpSpell,tag=!ExpSpell2] add ExpSpell2
#
tag @s[tag=SpellUpdate] add BookUpdate
tag @s[tag=SpellUpdate,nbt=!{SelectedItem:{id:"minecraft:paper",tag:{HideFlags:1,Enchantments:[{}]}}}] remove SpellUpdate