tag @s remove magus_unstable_check_tier_1
tag @s remove magus_unstable_check_tier_2
tag @s remove magus_unstable_check_tier_3

# Give back the wand after using
execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s amethyst_shard[consumable={consume_seconds:1,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,amethyst_wand:1b},custom_name='{"italic":false,"text":"Amethyst Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"1 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.9 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s stick[consumable={consume_seconds:0.5,animation:"block",sound:"minecraft:block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,netherite_wand:1b},custom_name='{"italic":false,"text":"Netherite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.4 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s blaze_rod[consumable={consume_seconds:0.3,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,firesteel_wand:1b},custom_name='{"italic":false,"text":"Firesteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.3 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s breeze_rod[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,coldsteel_wand:1b},custom_name='{"italic":false,"text":"Coldsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.99 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s chain[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,soulsteel_wand:1b},custom_name='{"italic":false,"text":"Soulsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,abyssium_wand:1b},custom_name='{"italic":false,"text":"Abyssium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1},item_model="minecraft:netherite_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,eternium_wand:1b},custom_name='{"italic":false,"text":"Eternium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1},item_model="minecraft:golden_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,malachite_wand:1b},custom_name='{"italic":false,"text":"Malachite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_1":1},item_model="minecraft:diamond_shovel"] 1

execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s amethyst_shard[consumable={consume_seconds:1,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,amethyst_wand:1b},custom_name='{"italic":false,"text":"Amethyst Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"1 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.9 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s stick[consumable={consume_seconds:0.5,animation:"block",sound:"minecraft:block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,netherite_wand:1b},custom_name='{"italic":false,"text":"Netherite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.4 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s blaze_rod[consumable={consume_seconds:0.3,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,firesteel_wand:1b},custom_name='{"italic":false,"text":"Firesteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.3 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s breeze_rod[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,coldsteel_wand:1b},custom_name='{"italic":false,"text":"Coldsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.99 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s chain[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,soulsteel_wand:1b},custom_name='{"italic":false,"text":"Soulsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,abyssium_wand:1b},custom_name='{"italic":false,"text":"Abyssium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1},item_model="minecraft:netherite_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,eternium_wand:1b},custom_name='{"italic":false,"text":"Eternium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1},item_model="minecraft:golden_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,malachite_wand:1b},custom_name='{"italic":false,"text":"Malachite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_2":1},item_model="minecraft:diamond_shovel"] 1

execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s amethyst_shard[consumable={consume_seconds:1,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,amethyst_wand:1b},custom_name='{"italic":false,"text":"Amethyst Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"1 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.9 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s stick[consumable={consume_seconds:0.5,animation:"block",sound:"minecraft:block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,netherite_wand:1b},custom_name='{"italic":false,"text":"Netherite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.4 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s blaze_rod[consumable={consume_seconds:0.3,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,firesteel_wand:1b},custom_name='{"italic":false,"text":"Firesteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.3 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s breeze_rod[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,coldsteel_wand:1b},custom_name='{"italic":false,"text":"Coldsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.99 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s chain[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,soulsteel_wand:1b},custom_name='{"italic":false,"text":"Soulsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,abyssium_wand:1b},custom_name='{"italic":false,"text":"Abyssium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1},item_model="minecraft:netherite_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,eternium_wand:1b},custom_name='{"italic":false,"text":"Eternium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1},item_model="minecraft:golden_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,malachite_wand:1b},custom_name='{"italic":false,"text":"Malachite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_3":1},item_model="minecraft:diamond_shovel"] 1

execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s amethyst_shard[consumable={consume_seconds:1,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,amethyst_wand:1b},custom_name='{"italic":false,"text":"Amethyst Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"1 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.9 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s stick[consumable={consume_seconds:0.5,animation:"block",sound:"minecraft:block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,netherite_wand:1b},custom_name='{"italic":false,"text":"Netherite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.4 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s blaze_rod[consumable={consume_seconds:0.3,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,firesteel_wand:1b},custom_name='{"italic":false,"text":"Firesteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.3 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s breeze_rod[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,coldsteel_wand:1b},custom_name='{"italic":false,"text":"Coldsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.6 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.99 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s chain[consumable={consume_seconds:0.5,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,soulsteel_wand:1b},custom_name='{"italic":false,"text":"Soulsteel Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.5 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"0.95 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1}] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,abyssium_wand:1b},custom_name='{"italic":false,"text":"Abyssium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1},item_model="minecraft:netherite_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,eternium_wand:1b},custom_name='{"italic":false,"text":"Eternium Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1},item_model="minecraft:golden_shovel"] 1
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}}] run give @s structure_block[consumable={consume_seconds:0.4,animation:"block",sound:"block.trial_spawner.ambient",has_consume_particles:false,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.illusioner.cast_spell"}]},custom_data={magus_wand:1b,malachite_wand:1b},custom_name='{"italic":false,"text":"Malachite Wand"}',lore=['" "','{"color":"gray","italic":false,"text":"When Held:"}','{"color":"dark_green","italic":false,"text":"0.4 Casting Speed"}','{"color":"dark_green","italic":false,"text":"1.8 Mana Efficiency"}','{"color":"dark_green","italic":false,"text":"1 Stability"}'],enchantment_glint_override=true,enchantments={"kiwi:magus_wand_tier_4":1},item_model="minecraft:diamond_shovel"] 1

# Set mana efficiency score
execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 10
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 14
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 16
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 16
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 18
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 18
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 18
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b}}}},tag=!magus_meditating] run scoreboard players set @s mana_efficiency 18

# Spell rotations
execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_1":1}}}}}] run function kiwi2:upgrades/classes/magus/spells/tier_1/tier_1_spell_cast_rotation

execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_2":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_2/tier_2_spell_cast_rotation

execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_3":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_3/tier_3_spell_cast_rotation

execute if entity @s[nbt={SelectedItem:{id:"minecraft:amethyst_shard",components:{"minecraft:custom_data":{magus_wand:1b,amethyst_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{magus_wand:1b,netherite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:blaze_rod",components:{"minecraft:custom_data":{magus_wand:1b,firesteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:breeze_rod",components:{"minecraft:custom_data":{magus_wand:1b,coldsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:chain",components:{"minecraft:custom_data":{magus_wand:1b,soulsteel_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,abyssium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,eternium_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation
execute if entity @s[nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{magus_wand:1b,malachite_wand:1b},"minecraft:enchantments":{levels:{"kiwi:magus_wand_tier_4":1}}}}},tag=!magus_meditating] run function kiwi2:upgrades/classes/magus/spells/tier_4/tier_4_spell_cast_rotation

advancement revoke @s only kiwi2:magus_cast_spell