R

make a mc plguin that makes it so everytime you are about to die it sets u to half a heart instead of dying, there should be 2 operator chat commands that are /immortal (username) and /mortal (username) everybody should start off as mortal. it should be secret that you are immortal, even to the immortal player, so no indicators that ur immortal.

Kodari AI
KodariMar 5 at 10:18 pm 5,740 (v2)

I’ll create a secret immortality plugin that prevents death for designated players without any visible indicators.

SecretImmortality
A stealth plugin that grants selective immortality to players. Instead of dying, immortal players are saved at half a heart with no visual or chat indicators. Features operator commands to toggle immortality status for any player. All players default to mortal status. Perfect for pranks or secret admin protection without breaking immersion.

Plugin created! When an immortal player takes lethal damage, they’re silently saved at half a heart with no messages or effects. Only operators using the commands will know who’s immortal.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 217
src/main/java/com/secretimmortality/ImmortalPlugin.java
package com.secretimmortality;

import com.secretimmortality.commands.ImmortalCommand;
import com.secretimmortality.commands.MortalCommand;
import com.secretimmortality.listeners.DamageListener;
import com.secretimmortality.manager.PlayerDataManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ImmortalPlugin extends JavaPlugin {
    
    private PlayerDataManager playerDataManager;
    
    @Override
    public void onEnable() {
        this.playerDataManager = new PlayerDataManager();
        
        getServer().getPluginManager().registerEvents(new DamageListener(this), this);
        
        getCommand("immortal").setExecutor(new ImmortalCommand(this));
        getCommand("mortal").setExecutor(new MortalCommand(this));
    }
    
    @Override
    public void onDisable() {
    }
}