import { world, Player, system } from '@minecraft/server';
import { Command } from '../../handler';
import { sendPlayerMessage, config } from '../../../config';
import { deadplayers } from '../../../lifesteal';

export function deadPlayersHelp(player: Player) {
    sendPlayerMessage(player, `§e§lLifesteal Help Page -- Deadplayers§r§6
> Get a list of all dead players

> Usage: ${config.prefix}deadplayers

> Examples: [
${config.prefix}deadplayers
]`);
}

new Command({
    name: `deadplayers`,
    code({ player }) {
        sendPlayerMessage(player, `§e§lDead Players ---§r§6\n${Array.from(deadplayers.keys()).length !== 0 ? Array.from(deadplayers.keys()).join(`\n`) : `§6No dead players found!`}`);
    }
});