StartupEvents.registry('palladium:abilities', (event) => {

    event.create('fallenheroes:teleport')

        .icon(palladium.createItemIcon('minecraft:ender_pearl'))

        .addProperty('max_distance', 'integer', 10, 'Max distance that the player can teleport.')

        .tick((entity, entry, holder, enabled) => {
            if (enabled) {
                const max_distance = entry.getPropertyByName('max_distance');
                let username = entity.getGameProfile().getName();
              entity.server.runCommandSilent(`execute as ${username} run tp ^ ^ ^${max_distance}`);
            };
        });
});

// thanks to fsang for the script
