{
	"name": {
		"text": "Magic User"
	},

	"icon": {
		"type": "texture",
		"texture": "charmsofbezel:textures/gui/omnitrix/mana.png"
	},

	"creative_tab": "charms",
	
	"max_level": 40,
	
	"capsule_color": 33333,
	
    "effects": [
		{
			"type": "glowing_hand",
			"color": [0.0, 0.4, 1.0],
			"size": 1.3,
		  "conditions": [
				{
					"type": "ability_enabled",
					"ability": "lucraftcore:toggle_power"
				}
			]
        }
    ],
	
	"abilities": {
	"mana system magic": {
		"ability": "lucraftcore:command_loop",	
			"show_in_bar": false,	
			"icon": { "type": "internal" },		
			"commands": [
			"/scoreboard players remove @s[score_manabar_min=1] manabar 1",
			"/scoreboard objectives add manabar dummy", 
			"scoreboard players tag @s remove min_mana",
			"scoreboard players tag @s[score_mana_min=3] add min_mana",
			"/scoreboard objectives add mana dummy", 
			"/scoreboard objectives add mana_recharge dummy", 
			"/scoreboard players add @s mana_recharge 1", 
			"/scoreboard players add @s[score_mana_recharge_min=100] mana 3", 
			"/scoreboard players set @s[score_mana_recharge_min=100] mana_recharge 1", 
			"/scoreboard players set @s[score_manabar=0,score_mana_min=201] mana 200",
			"/execute @s[score_manabar=0,score_mana_min=0] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=20] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=40] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=60] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=80] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=100] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=120] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=140] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=160] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=180] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"▋▋\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]",
			"/execute @s[score_manabar=0,score_mana_min=200] ~ ~ ~ title @s actionbar [{\"text\":\"\",\"color\":\"dark_gray\"},{\"text\":\"▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋▋\",\"color\":\"blue\"},{\"text\":\"\",\"color\":\"gray\"},{\"text\":\"\",\"color\":\"dark_gray\"}]"]
		},
	"Enable Magic": {
			"ability": "lucraftcore:toggle_power",
 			"conditions": [{
             	 	"type": "lucraftcore:held_item",
              		"item": "charmsofbezel:spell_book_chest",
              		"hand": "off_hand"}],
			"title": {"text": "Read spell book"},
			"bar_color": "blue"
		},
		"basic mana blast": {
			"ability": "lucraftcore:energy_blast",
			"cooldown": 20,
			"title": {"translate": "Mana blast"},
			"damage": 4.0,
			"color": [0, 70, 150],
			"required_ability": "Enable Magic",
			"bar_color": "light_blue",
 			"conditions": [{
             	 	"type": "lucraftcore:scoreboard_tag",
              		"tag": "min_mana"}]
	      	},
		"basic mana blast com": {
			"ability": "lucraftcore:command",
			"show_in_bar": false,
			"parent_ability": "basic mana blast",
			"commands": ["scoreboard players remove @s[score_mana_min=1] mana 5"]
		}
	}
}