Core Mechanics - TDHunterrr/Farlands-Lifesteal GitHub Wiki
⚔️ Core Mechanics
Farlands Lifesteal turns every player encounter into a strategic gamble. Below is the full technical breakdown of health calculation, death logic, bans, and invulnerability.
🩸 Health System
| Metric | Value | In-Game HP |
|---|---|---|
| Default Health | 10 Hearts | 20.0 HP |
| Minimum Health | 0 Hearts | 0.0 HP (Eliminated) |
| Maximum Health Cap | 20 Hearts | 40.0 HP |
| Health Per Heart | 1 Heart | 2.0 HP |
- Health Attribute: Max health is stored in the player's vanilla
generic.max_healthattribute base value. - Persistence: Health adjustments persist across dimension switching, death/respawn, and server restarts.
💀 Death & Heart Loss
When a player dies (regardless of damage source—PvP, mobs, fall damage, or void):
- Health Reduction: Their base max health is reduced by 1 heart (2.0 HP).
- Item Drop: A physical Heart item is dropped at the death coordinates.
- Pickup Protection: Dropped hearts have a 40-tick (2-second) pickup delay, ensuring the killer or nearby players don't instantly vacuum it without noticing.
- Respawn Health: Upon respawning, the player respawns with their new maximum health.
🚫 Elimination & Banning
When a player loses their final heart and reaches 0 max health:
- Their
generic.max_healthattribute is set to0.0. - An entry is created in the server's official User Ban List (
banned-players.json):- Reason:
"You ran out of hearts!" - Source:
"Lifesteal"
- Reason:
- A personalized Revive Token bound to the eliminated player drops at their death coordinates.
- The server disconnects the player with a red kick screen:
"You lost all your hearts and have been banned!"
🛡️ Spawn & Join Protection
To prevent spawn-camping and trap abuse:
- Any player rejoining after a revival or login receives Resistance V (100% damage immunity) for 10 seconds (200 ticks).
- Dynamic Packet Detection:
- The server records the player's initial join coordinates.
- The moment the player moves (
handleMovePlayerpacket), the invulnerability effect is instantly stripped. - This guarantees that protected players cannot attack or reposition while immune.