
    StartupEvents.registry('palladium:abilities', (event) => {
        event.create('heroes:replicate')
            .icon(palladium.createItemIcon('palladium:vibranium_circuit'))

            .tick((entity, entry, holder, enabled) => {
                if (enabled) {
                    let username = entity.getGameProfile().getName();
					let username_true = username.toLowerCase();
                    let scoreboard = Utils.server.scoreboard;
					
					let scoreboard_obj = scoreboard.getObjective('Heroes.Power.Icon.Repli');
                    let score = scoreboard.getOrCreatePlayerScore(username, scoreboard_obj);
                    let value = score.getScore();
					
					let scoreboard_obj_a = scoreboard.getObjective('Heroes.Replication.Slot.Selected');
                    let score_a = scoreboard.getOrCreatePlayerScore(username, scoreboard_obj_a);
                    let value_a = score_a.getScore();

					
						let power_max = global.power_amount;
						let power = global['ability_' + value];


					
					if (power == 'Levitation') {
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players operation @s Heroes.Levitation.Speed.Base.Replication = @s Heroes.Levitation.Speed.Base.Hold");
					}
					if (power == 'Bone_Protrusion') {
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players operation @s Heroes.Bone.Var.Replicated = @s Heroes.Bone.Var.Hold");
					}
					
					if (value >= 1) {
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s Heroes.ReplicationPower" + value_a + " " + value + "");
					}
					for (let power_list = 0; power_list <= power_max; power_list++) {
						let power = global['ability_' + power_list];
							
					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s remove Powers." + power + "");

						}
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s Heroes.Levitation.Speed.Base.Hold 0");
					entity.server.runCommandSilent("execute as " + username + " at @s run scoreboard players set @s Heroes.Bone.Var.Hold 0");
					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s remove Powers.Ability");
					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s add Heroes.Replication.Next");
					}
            });
    });