
    StartupEvents.registry('palladium:abilities', (event) => {
        event.create('heroes:ability_ocular_cycle')
            .icon(palladium.createItemIcon('palladium:vibranium_circuit'))
			.addProperty("cycle_score", "string", "Heroes.Power.Icon", "Determins max energy for the power and what the math will be based on")
            .tick((entity, entry, holder, enabled) => {
                if (enabled) {
					const cycle_score = entry.getPropertyByName('cycle_score');
                    let username = entity.getGameProfile().getName();
					let username_true = username.toLowerCase();
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard objectives add " + cycle_score + " dummy");
                    let scoreboard = Utils.server.scoreboard;
					let scoreboard_obj = scoreboard.getObjective(entry.getPropertyByName("cycle_score"));
                    let score = scoreboard.getOrCreatePlayerScore(username, scoreboard_obj);
                    let value = score.getScore();
					let power_max = global.power_amount;
					if (containsTag(entity.getTags().toArray(), 'Heroes.Ocular.Next')) {
						value += 1;
						if (value > power_max) {
							value = - 2;
						}
					for (let power_list = value; power_list < power_max +2; power_list++) {
						let power_cap = global['ability_' + power_list];
						if (power_list > power_max) {
						power_list = -2; 
						continue;
							}
						if (power_list == -1) {
						entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s " + cycle_score + " " + power_list + "");
						entity.server.runCommandSilent("execute as " + username + " at @s run tag @s remove Heroes.Ocular.Next");
						break;
						}
						if (power_cap != 'Absorption' && power_cap != 'Transferal' && power_cap != 'Interplay' && power_cap != 'Empathic_Mimicry' && power_cap != 'Intuitive_Aptitude') {
						entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard objectives add Powers." + power_cap + " dummy");
					if (containsTag(entity.getTags().toArray(), 'Powers.Ocular.' + power_cap)) {
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s " + cycle_score + " " + power_list + "");
					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s remove Heroes.Ocular.Next");
					break;
								}
							}
						}
					}
						
						if (containsTag(entity.getTags().toArray(), 'Heroes.Ocular.Prev')) {
							value -= 1;
					let power_max = global.power_amount;
					for (let power_list = value; power_list > -3; power_list--) {
						let power_cap = global['ability_' + power_list];
						if (power_list < -1) {
						power_list = power_max + 1; 
						continue;
							}

						if (power_list == -1) {
						entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s " + cycle_score + " -1");
						entity.server.runCommandSilent("execute as " + username + " at @s run tag @s remove Heroes.Ocular.Prev");
						break;
							}
							if (power_cap != 'Absorption' && power_cap != 'Transferal' && power_cap != 'Interplay' && power_cap != 'Empathic_Mimicry' && power_cap != 'Intuitive_Aptitude') {
						entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard objectives add Powers." + power_cap + " dummy");
					if (containsTag(entity.getTags().toArray(), 'Powers.Ocular.' + power_cap)) {
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s " + cycle_score + " " + power_list + "");
					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s remove Heroes.Ocular.Prev");
					break;
								}
							}
						}
					}
				}
			});
    });