import { system } from "@minecraft/server";
import { Command } from "../../handler";
import { sendPlayerMessage } from "../../../config";
import { lifesteal } from "../../../lifesteal";


new Command({
    name: `reviveamount`,
    staffOnly: true,
    code({ player, args }) {
        let amount = +args[0];
        if (isNaN(amount) || amount < 1 || amount > 15) return sendPlayerMessage(player, `§8[§cX§8] §cYou can only set the revive amount to numbers from 1-15!`);
        if (+lifesteal.get(`heartlose`) > amount) return sendPlayerMessage(player, `§8[§cX§8] §cYou can't set the revive amount lower than the hearts lost amount!`);

        lifesteal.set(`reviveamount`, `${amount}`);
        sendPlayerMessage(player, `§8[§a/§8] §aSet the revive amount to ${amount}`);
    },
});