noobrun

Develop a Minecraft Paper plugin named "LifePoints" for Paper API 1.21.11, featuring a point system where players start with 30 points, displayed in real-time below their nametag using the Scoreboard API. Implement point deductions upon player deaths, with configurable options to either set players to spectator mode or temporarily ban them upon reaching zero points. Include a customizable craftable "Point Token" item that grants +10 points when right-clicked, with anti-abuse measures for point limits and crafting restrictions, and provide commands for point management and configuration, all while ensuring optimized performance and clean code structure with proper event listeners.

Kodari AI
KodariFeb 26 at 4:00 pm 18,716 (v2)

I’ll create a comprehensive LifePoints plugin with a point system, scoreboard display, and token mechanics.

LifePoints
A survival challenge plugin where players start with 30 life points displayed below their nametag. Points decrease on death, and reaching zero triggers configurable punishment (spectator mode or temporary ban). Features craftable Point Tokens that restore points, with anti-abuse systems including daily limits, cooldowns, and point caps. Includes admin commands for point management and full configuration options.

I’ll create a complete LifePoints plugin with point tracking, scoreboard display, and token mechanics.

Complete LifePoints plugin created with full point tracking, scoreboard display, death penalties, craftable tokens with anti-abuse systems, comprehensive admin commands, and optimized architecture for Paper 1.21.1.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
14 1,045
src/main/java/com/lifepoints/LifePoints.java
package com.lifepoints;

import com.lifepoints.command.LifePointsCommand;
import com.lifepoints.config.ConfigManager;
import com.lifepoints.listener.DeathListener;
import com.lifepoints.listener.PlayerListener;
import com.lifepoints.listener.TokenListener;
import com.lifepoints.manager.DataManager;
import com.lifepoints.manager.PunishmentManager;
import com.lifepoints.manager.ScoreboardManager;
import com.lifepoints.manager.TokenManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class LifePoints extends JavaPlugin {
    private ConfigManager configManager;
    private DataManager dataManager;
    private ScoreboardManager scoreboardManager;
    private TokenManager tokenManager;
    private PunishmentManager punishmentManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.dataManager = new DataManager(this);
        this.scoreboardManager = new ScoreboardManager(this);
        this.tokenManager = new TokenManager(this);
        this.punishmentManager = new PunishmentManager(this);

        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new DeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TokenListener(this), this);

        getCommand("lifepoints").setExecutor(new LifePointsCommand(this));

        if (configManager.isTokenRecipeEnabled()) {
            tokenManager.registerRecipe();
        }

        Bukkit.getOnlinePlayers().forEach(player -> {
            dataManager.loadPlayerData(player.getUniqueId());
            scoreboardManager.updateScoreboard(player);
        });

        getLogger().info("LifePoints has been enabled!");
    }

    @Override
    public void onDisable() {
        Bukkit.getOnlinePlayers().forEach(player -> {
            dataManager.savePlayerData(player.getUniqueId());
            scoreboardManager.removeScoreboard(player);
        });

        dataManager.saveAll();
        getLogger().info("LifePoints has been disabled!");
    }
}