
    StartupEvents.registry('palladium:abilities', (event) => {
        event.create('heroes:catalyst_transfer')
            .icon(palladium.createItemIcon('palladium:vibranium_circuit'))
			.addProperty('reach_range', 'integer', 3, 'Range the ability can reach')

            .tick((entity, entry, holder, enabled) => {
                if (enabled) {
                    let username = entity.getGameProfile().getName();
					let username_true = username.toLowerCase();
					const reach_range = entry.getPropertyByName('reach_range');

					let target_entity = entity.rayTrace(reach_range).entity
					
					if (target_entity != null && target_entity.type == "minecraft:player") {
					entity.server.runCommandSilent("execute as " + username + " at @s unless score " + target_entity.getGameProfile().getName() + " Powers.Catalyst matches 1.. run scoreboard players operation " + target_entity.getGameProfile().getName() + " Powers.Catalyst >< @s Powers.Catalyst");

					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s add Heroes.Prock");
					entity.server.runCommandSilent("execute as " + username + " at @s run playsound minecraft:entity.vex.ambient master @a ~ ~ ~ 2 2");
					entity.server.runCommandSilent("execute as " + username + " at @s run tag @s add Heroes.Next");
					}
				}
            });
    });