teampingu

create a plugin that gives you invincibility for 15 minutes after dying. equipping armor removes this invincibility. also make it so if they leave and join back their invincibility still continues. players that have invincibility cant damage other players

Kodari AI
KodariJul 5 at 4:24 pm 1
DeathShield
A post-death invincibility system that grants players 15 minutes of invulnerability after dying. Invincibility is lost upon equipping any armor piece and persists across server logins. Invincible players cannot damage other players. Features visual absorption heart indicator, configurable duration, and automatic data persistence for seamless reconnection handling.

I’ll build this from scratch — main plugin class, manager, listener, config, and build files.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
7 336
src/main/java/com/deathshield/DeathShield.java
package com.deathshield;

import org.bukkit.plugin.java.JavaPlugin;

public class DeathShield extends JavaPlugin {

    private InvincibilityManager manager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        manager = new InvincibilityManager(this);
        getServer().getPluginManager().registerEvents(new InvincibilityListener(this, manager), this);
        manager.loadAllPlayers();
        getLogger().info("DeathShield enabled.");
    }

    @Override
    public void onDisable() {
        if (manager != null) {
            manager.saveAllPlayers();
        }
        getLogger().info("DeathShield disabled.");
    }

    public InvincibilityManager getManager() {
        return manager;
    }
}