package eu.mhsl.minenet.minigames.command.privileged;

import eu.mhsl.minenet.minigames.command.PrivilegedCommand;
import net.minestom.server.command.builder.arguments.ArgumentType;
import net.minestom.server.entity.Player;
import net.minestom.server.entity.PlayerSkin;

public class SkinCommand extends PrivilegedCommand {
    public SkinCommand() {
        super("skin");

        addSyntax((sender, context) -> {
            if(sender instanceof Player p) {
                p.setSkin(PlayerSkin.fromUsername(context.getRaw("target")));
            }
        }, ArgumentType.Entity("target").onlyPlayers(true).onlyPlayers(true));
    }
}
