What a lifesteal SMP plugin has to handle
Lifesteal sounds simple: kill a player, take a heart. In practice the plugin changes each player's max health attribute, so it must store that value across restarts, apply it again on join and keep it inside your limits. A PersistentDataContainer on the player or a small data file both work.
The details are where SMPs differ. Do falls, lava and creepers cost a heart, or only player kills? Can hearts be withdrawn as items and traded? What happens at zero: a temporary ban, spectator mode until a revive, or the end of that player's season?
- Heart steal on kill, optional loss on natural death
- Heart cap and floor set in config.yml
- Heart item: recipe, /withdraw, right-click to redeem
- Zero hearts: temporary ban or spectator mode, plus a revive
- Cooldown per killer and victim pair against alt farming
- Combat log: leaving mid-fight counts as a death
