SetImmortal

SetImmortal is a plugin that grants a player immortality while preserving normal gameplay visuals. Immortal players can still be hit, burn, fall, and trigger all standard damage effects, but their health never decreases. discord: @yeimarei

30

Quick challenge

How far can you run before the mobs catch you?

SetImmortal

1. Overview

SetImmortal is a Paper plugin for Minecraft Java 1.21.10 that allows operators or console to grant or remove an immortal status for any username. Immortal players still appear to take damage normally (animation, sound, knockback, fire, etc.) but never lose health. The system works even if the player is offline because usernames are stored instead of active player objects.

2. Commands

/setimmortal <username> — Adds a player to the immortal list

/removeimmortal <username> — Removes a player from the immortal list

Rules:

Only OP or console can use commands

Duplicate entries are prevented

Works for offline players

3. How It Works

The plugin listens to damage events. When a player takes damage:

Check if entity is a player

Check if username is in immortal list

If yes → set damage to 0 (do not cancel event)

This preserves all visual and physical effects while preventing health loss.

4. Storage System

File automatically generated:

plugins/SetImmortal/players.yml

Format:

immortals: - PlayerName

Rules:

Loads safely if missing

Saves instantly after changes

Never deletes other entries accidentally

5. Damage Protection Coverage

Health loss is prevented from all damage sources, including:

PvP, mobs, fall damage, fire/lava, explosions, magic, suffocation, custom plugin damage

6. Permissions

Allowed:

Server console

Operators

Denied:

All non-OP players

(No permission plugin required.)

7. Stability Requirements

The plugin must not crash if:

data file missing

file empty

player offline

invalid username

server reload

command typo

8. Plugin.yml Requirements

Must include:

name

main class

version

api-version

commands list

9. Code Standards

clean class structure

null-safe checks

no deprecated API

no NMS usage

uses plugin data folder API

safe file handling

10. Expandability Design

Architecture should allow easy future additions such as:

immortallist command

clear command

UUID support

permission nodes

temporary immortality

world-specific immortality

ADS