Anthony Clarkson

can you make me a 5 live system

Kodari AI
KodariAug 29 at 9:19 pm 1
FiveLivesSystem
A Minecraft plugin implementing a five-lives survival system where players start with five lives. Lives are lost on death and regained through configurable methods such as kills, playtime rewards, or admin commands. Includes persistent storage via YAML, a lives GUI showing current status, death-ban mechanics with configurable ban duration, leaderboard tracking, and comprehensive admin commands for managing player lives. Features configurable messages, permissions, and world-specific death handling.
  1. Create the Gradle Paper plugin scaffold and metadata.

  2. Implement persistent five-life storage with configurable loss and elimination behavior.

  3. Add death/join listeners and /lives player/admin commands with tab completion.

  4. Add default configuration and messages.

Built a complete persistent five-life system.

  • Players start with 5 lives, configurable in config.yml.

  • Players lose a life on death.

  • Lives persist in plugins/FiveLives/lives.yml.

  • Players receive life-loss messages.

  • Players with 0 lives can be kicked, banned, or have a command executed.

  • Added /lives and /life commands:

    • /lives

    • /lives <player>

    • /lives set <player> <amount>

    • /lives add <player> <amount>

    • /lives remove <player> <amount>

    • /lives reset <player>

  • Added admin permission: fivelives.admin

  • Added tab completion and configurable messages.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
9 432
src/main/java/com/kodari/fivelives/FiveLivesPlugin.java
package com.kodari.fivelives;

import java.util.Objects;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class FiveLivesPlugin extends JavaPlugin {

    private LivesManager livesManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        livesManager = new LivesManager(this);
        livesManager.load();

        getServer().getPluginManager().registerEvents(new LivesListener(this, livesManager), this);

        LivesCommand livesCommand = new LivesCommand(this, livesManager);
        PluginCommand command = Objects.requireNonNull(getCommand("lives"));
        command.setExecutor(livesCommand);
        command.setTabCompleter(livesCommand);
    }

    @Override
    public void onDisable() {
        if (livesManager != null) {
            livesManager.save();
        }
    }

    public LivesManager getLivesManager() {
        return livesManager;
    }
}