SMP mechanic
Lifesteal plugin: make every kill cost a heart
Lifesteal means a player kill moves one heart of maximum health from the victim to the killer. Reaching zero ends your run. Minecraft has no such rule, so a plugin has to store each player's heart count itself and reapply it on every join, because a fresh session hands back the default twenty.
Lifesteal is the rule that made SMP servers watchable. It does one thing, and it does it permanently: winning a fight makes you stronger, losing one makes you weaker, and enough losses take you off the server. This page covers what the rule really involves once you have to write it, then hands you a description you can copy into the generator and adjust.
- Why maximum health resets on every join, and what to do about it
- Which deaths should move a heart, and which ones must not
- The cap, the floor, and what happens at zero
- Revival: bringing back a player who is not even online
- A ready-to-copy prompt, then a compiled .jar you can play before installing
The rule, and why it works so well
A player kills another player. The killer gains one heart of maximum health, permanently. The victim loses one, permanently. Run out and your season is over.
What makes it work is that it never resets. In vanilla survival, a lost fight costs you your inventory and an hour of walking. Under lifesteal it costs you a piece of your character that you can only get back by taking it from somebody else. That turns a random encounter in a cave into something worth avoiding or worth hunting, and it gives spectators a number to follow.
It also scales down well. A server of six friends and a server of two hundred strangers both work under the same rule, because the rule needs no moderation to produce consequences.
The trap: maximum health is not stored where you think
This is where most first attempts break. Maximum health in Minecraft is an attribute carried by the player entity. A plugin can set it, and the player will see the extra hearts immediately. Then the server restarts, or the player reconnects, and the attribute is back to the default twenty.
So the attribute is never the source of truth. Your plugin keeps the real value in its own storage, keyed to the player, and every time a player joins it reads that value back and applies it to the attribute. Everything else in the plugin reads and writes your storage, never the attribute directly.
A file per player works up to a point. A small database is better as soon as there are more than a handful of players, and it is what lets a leaderboard exist without opening every file. Whichever you choose, write on the events that matter, a kill and a quit, rather than on a timer alone, so a crash costs at most one change.
- Your storage is the truth, the attribute is only its reflection
- Reapply the stored value on every join, without exception
- Write on kill and on quit, so a crash never rewrites the season
- Health itself is capped by the game, so keep your own maximum sane
Which deaths move a heart, and which ones must not
Falling into lava is not a kill. Neither is drowning, starving, or being shot by a skeleton. If your plugin reacts to every death, players will lose hearts to the terrain and gain nothing back, the total on the server will only ever fall, and the season ends early and unfairly.
So the rule fires on one condition: the death was caused by another player. That covers melee, and it should also cover the arrow fired from across a ravine, which is a player kill even though the player never touched the victim.
Then decide the grey areas deliberately, because your players will find them the first week. Does a pet wolf killing on its command count? Does a trap built by a player and triggered days later? Does a kill in a designated arena count at all, or is the arena exempt so people can spar without spending hearts? There is no correct answer, only the answer your server picks and states.
- Only a death caused by another player moves a heart
- Arrows and thrown potions still count as that player
- Decide about pets, traps and arenas before someone tests them for you
- State the answer in chat or in a rules command, so nobody has to guess
The cap, the floor, and what zero means
Without a cap, the best fighter on the server eventually becomes unkillable, and the mechanic stops producing fights. A ceiling, often around twice the default, keeps the strongest player merely strong. A kill against someone already at the cap should then either do nothing or drop an item, so the fight still had a point.
The floor is the more interesting decision, because it decides what elimination feels like. A ban is the harshest and the clearest: you are out, and the server has one fewer player. Spectator mode keeps the person around, watching their friends, still in the conversation, which usually keeps a community together longer. Some servers send the player back with a single heart instead, which is not elimination at all but a very tense demotion.
Whatever you pick, the state has to survive a restart like everything else, and it has to be enforced on join rather than only at the moment of death. A player eliminated while the server was down should still be eliminated when it comes back.
- A ceiling keeps the strongest player beatable
- Say what a kill on a capped player is worth, so it is never wasted
- Ban, spectator, or one heart back: pick one and be consistent
- Enforce the eliminated state on join, not only on death
Hearts as items, and the way back
Most lifesteal servers add a heart item: a craftable object that gives one heart when used, and often a matching item that lets you take a heart out and hand it to somebody else. That single addition changes the whole economy of the server, because hearts stop being purely a fight outcome and become something you can farm, trade or gift.
Price it carefully. A heart item that is cheap to craft removes the tension the whole mechanic exists to create, since anyone can simply build their way back. Expensive enough that crafting one is an event, and the item becomes a reason to cooperate instead.
Revival works the same way. An item that brings back an eliminated player is the mechanic that keeps a server alive past its first wave of eliminations, and it has to handle a target who is not online: the revival is recorded, and applied the next time that player logs in. Without that, the only revivable players are the ones still sitting in spectator mode, which is exactly the wrong half.
- A heart item makes hearts tradable, which changes everything
- Craft cost is the balance dial, not the heart value
- Revival has to work on an offline player, applied at their next join
- Announce gains, losses, eliminations and revivals, or nobody feels them
Build a lifesteal plugin for a Minecraft SMP on Paper 1.21. When a player kills another player, the killer gains 1 heart of maximum health and the victim loses 1. Only deaths caused by another player count, including arrows and thrown potions, never fall damage, lava, drowning or mobs. Maximum 20 hearts, minimum 0. Store each player heart count in SQLite and reapply it on every join, since maximum health resets otherwise. A kill on a player already at the maximum drops a heart item instead. Add a heart item crafted with 8 diamond blocks around a golden apple that gives 1 heart when right clicked, and a revival beacon crafted with 4 netherite ingots and a nether star that brings back an eliminated player even if they are offline, applied at their next login. At 0 hearts the player is put in spectator mode, and that state survives restarts. Add /hearts, /hearts <player>, /sethearts <player> <number> for admins, and /hearts top for the leaderboard. Announce every gain, loss, elimination and revival in chat.
What to check before you open it up
Persistence first, always. Join, take a heart from someone, disconnect, reconnect, and confirm the number is still right. Then restart the server and check again. A lifesteal plugin that forgets on restart is not a plugin with a bug, it is a season that never happened.
Then the deaths that should do nothing. Jump off something, drown, let a mob finish you, and confirm that nobody gained a heart and, depending on your rule, that you did not lose one either. This is the check people skip and regret.
Then the boundaries. A player at the maximum being killed. A player at one heart being killed. A revival on somebody who is offline. Those three cases are where a lifesteal plugin either holds together or produces the argument that ends the season.
- Reconnect and restart, and confirm the count held both times
- Die to the terrain and to a mob, and confirm nothing moved
- Test the cap, the floor and an offline revival
- Only then tune the numbers
Frequently asked questions
What is a lifesteal plugin?
It is a plugin that moves maximum health between players: killing another player gives you one of their hearts, permanently, and losing all of yours ends your run. Minecraft has no such rule, so it is entirely server-side code.
Why do the hearts reset when a player rejoins?
Because maximum health is an attribute on the player entity and a fresh session restores the default. The real count has to live in the plugin storage and be reapplied on every join.
Should falling into lava cost a heart?
Not if you want the season to last. Only a death caused by another player should move a heart, otherwise the total health on the server only ever falls and nobody gains anything back.
What should happen at zero hearts?
Ban, spectator mode, or a return with a single heart. Spectator mode usually keeps a community together longest because the eliminated player stays in the conversation, but any of the three works as long as it is consistent and survives a restart.
Can players get hearts back without killing anyone?
Yes, if you add a craftable heart item. Make it expensive, because a cheap one removes the tension the mechanic exists to create. A revival item that works on offline players is the other common way back.
Do I need to know Java to build this?
No. Describe the rule in plain English, listing which deaths count, the cap, the floor, the commands and the messages, and Minax writes the Java, compiles it and returns a .jar.
Does it work on Paper, Spigot or Folia?
Yes, name your platform and Minecraft version in the description. Folia has its own threading rules, so say so explicitly if that is what you run.
Can I test it before installing it on my server?
Yes. The compiled .jar can be launched online on a real server, which is the only honest way to check that the heart count survives a disconnect and a restart.
Ready to build your Minecraft plugin?
Describe it in plain English, get a compiled .jar. Free. No Java required.
Generate my lifesteal plugin