Configuration
The Lifestealer plugin is highly configurable and can be customized to suit your server's needs. This page will walk you through the various configuration options available in the config.yml
file.
You can always reload the configuration in-game by running the /lifestealer reload
command.
Default Configuration
yml
storage:
# The kick message when a player tries to join, but its information couldn't be retrieved from the storage system
error kick message: "<red>There was an error with the storage system, please contact an administrator."
type: "h2" # Possible values: "sqlite", "h2", "mysql", "postgresql"
path: "users.db"
## Example for MySQL/PostgreSQL/MariaDB:
# type: "mysql" or "postgresql" or "mariadb"
# address: "localhost:3306"
# database: "mysql" # The name of the database
# username: "root"
# password: "12345678"
## Extra properties for HikariCP, check https://github.com/brettwooldridge/HikariCP?tab=readme-ov-file#gear-configuration-knobs-baby for more configuration options
## The properties for MySQL are already optimized for the best performance as in https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
# extra properties: []
items:
- name: "default"
heart amount: 1
item:
type: "paper"
display name: "<color:#ff0000>Normal Heart</color>"
lore:
- "<gray>Right click to add <white>+1<heart></white> to your health"
glint: true
enchantments:
- name: "unbreaking"
level: 1
custom model data: 144
flags:
- "hide enchants"
# The name of the item in the list above that should be dropped when a player dies
# To avoid confusion and misuse, this must exist in the "items" list above
# The amount of hearts the player will lose will be the same as the "heart amount" defined in the item (unless changed by other plugin that hooks into Lifestealer)
item to drop when player dies: "default"
# Restrictions to heart drops when a player dies
#
# Possible restrictions:
# - "death cause": restrict based on the cause of death (fall, drowning, etc.)
# - "cause": the cause of death (check https://jd.papermc.io/paper/1.21.1/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html for more causes)
# - "same ip": restrict based on the player's IP address
# - "world": restrict based on the world the player is in
# - "world": the name of the world
# Possible actions:
# - "drop": the player will drop the heart item and lose the hearts (default)
# - "not drop": the player won't drop the heart item but will still lose the hearts
# - "not remove hearts": the player won't lose the hearts and won't drop the heart item
#
# This restriction list will be checked in order, if a restriction is met, the action will be executed and the rest of the list will be ignored
heart drop restrictions:
- type: "death cause"
cause: "fall"
# If the cause is fall (player dies by falling)
action: "not drop"
# They won't drop the item but will still lose the hearts
- type: "death cause"
cause: "drowning"
# If the cause is drowning (player dies by drowning)
action: "not remove hearts"
# They won't lose the hearts and won't drop the item
- type: "same ip"
# If the player is killed by someone with the same IP address
action: "not drop"
# They won't drop the item but will still lose the hearts
- type: "world"
world: "nether"
action: "not drop"
# If the player dies in the nether, they won't drop the item but will still lose the hearts
- type: "world"
world: "end"
# If the player dies in a world named "end"
action: "not remove hearts"
# They won't lose the hearts and won't drop the item
# The amount of hearts a player should start with when they first join the server, a heart consists of 2 health points
starting hearts: 10
# Define rules that will change values based on player's permissions
rules:
# The rules that will be applied to players that don't have any of the groups below (not to be confused with the "default" item, these are not related)
default:
# The maximum amount of hearts a player can have
max hearts: 10
# The minimum amount of hearts a player can have, if they lose more than this amount they will be banned
min hearts: 5
# The amount of time a player will be banned for if they lose more than the minimum amount of hearts
ban time: 1d 12h 30m
# The amount of hearts the player will have when they return from a ban
return hearts: 7
# Rules overrides applied to players with specific permissions
groups:
# If the player has permission "vip"
- permission: "vip"
# Change the maximum amount of hearts to 15
max hearts: 15
# and the minimum amount of hearts to 3
min hearts: 3
# The ban time and return hearts will be the same as the default
# If the player has permission "admin"
- permission: "admin"
# Change the maximum amount of hearts to 20
max hearts: 20
# and the ban time to 15 seconds
ban time: 15s
# If the player has multiple groups, the overrides will be applied in the order they are defined here
# So if a player has both "vip" and "admin" permissions, they will have:
# - 20 max hearts
# - 3 min hearts
# - 15 seconds of ban time
# - 7 return hearts
# Ban system configuration
# When a player loses more hearts than the minimum amount defined in the rules, they will be banned for the time defined in the rules
ban settings:
# The message that will be sent to the player when they get banned and is online
# For the duration placeholder check `duration format` section for configuration
# For the date placeholder check https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html for usage and more examples
kick message: "<red>You have been banned for <white><duration:'extended'><red> for losing too many hearts.\nYou will be unbanned at <white><date:'yyyy-MM-dd HH:mm:ss'><red>."
# The message that will be sent to the player when they try to join while banned
# For the duration placeholder check `duration format` section for configuration
# For the date placeholder check https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html for usage and more examples
join message: "<red>You are banned for <white><remaining:'extended'><red> for losing too many hearts.\nYou will be unbanned at <white><date:'yyyy-MM-dd HH:mm:ss'><red>."
# The commands that will be executed by the console when a player gets bellow the minimum amount of hearts
# The following placeholders can be used:
# - <player>: the player's name that will be banned
# - <duration>: the time in seconds the player will be banned for
commands:
- "say <player> has been eliminated for <duration>s for losing too many hearts (remove this message in the config)"
# - "ban <player> <duration> Hearts lost"
# If you want to not use the ban system of Lifestealer and wish to use your own, set this to true
# This will prevent the plugin from banning players or not allow them to join the server
#
# The commands in "commands" will still be executed even if this is set to true
# and will also save the player ban status internally in the database but won't use
# it for anything (you can lookup that data using the developer API)
external: false
# The format for the duration placeholders
duration format:
# You can add more formats and use them in the messages with <duration:'<format>'>
extended:
# The separator between the different units
separator: ", "
# The separator between the last two units
last separator: " and "
# The translations for the units
translations:
days:
singular: " day"
plural: " days"
hours:
singular: " hour"
plural: " hours"
minutes:
singular: " minute"
plural: " minutes"
seconds:
singular: " second"
plural: " seconds"
# The amount of units to show, 0 will show all units
# Example: For the duration 1d 2h 3m 4s with 3 units, it will show "1 day, 2 hours and 3 minutes"
amount of units to show: 3
# If it should show zero values
show zero values: false
short:
separator: ""
last separator: ""
translations:
days:
singular: "d"
plural: "d"
hours:
singular: "h"
plural: "h"
minutes:
singular: "m"
plural: "m"
seconds:
singular: "s"
plural: "s"
amount of units to show: 0
show zero values: true
# You can add more formats here
messages:
# The messages that will be sent to the player when they perform certain actions
#
# These messages have many components such as chat message, action bar message,
# title, subtitle, sound and more which you can combine to create complex interactions.
#
# The chat, action bar, title and subtitle components are formatted using the MiniMessage format.
# Check https://docs.adventure.kyori.net/minimessage.html for more information and examples.
#
# Examples:
# » message key: "<red>Hello"
# Sends a red chat message to the player
# » message key:
# message: "<red>Hello"
# action bar: "<yellow>World"
# Sends a red chat message and a yellow action bar message to the player
# » message key:
# title: "<green>Hi"
# subtitle: "<blue>There"
# Sends a green title and a blue subtitle to the player
# » message key:
# message: "<papi:player_uuid>"
# Uses PlaceholderAPI to parse %player_uuid% and sends it to the player (requires PlaceholderAPI to be installed)
# » message key:
# title: "<green>Hi"
# subtitle: "<blue>There"
# title times:
# fade in: 10
# stay: 20
# fade out: 10
# Sends a green title and a blue subtitle to the player with the specified fade in, stay and fade out times (in ticks)
# » message key:
# title: "<green>Hi"
# sound: minecraft:entity.player.levelup
# Sends a green title to the player and plays the level up sound
# » message key:
# action bar: "<green>Hi"
# sound:
# key: minecraft:entity.player.levelup
# volume: 0.5
# pitch: 0.2
# Sends a green action bar message to the player and plays the level up sound with a volume of 0.5 and a pitch of 0.2
command item give success: "<green>Gave <white>x<amount> <item></white> heart item to <white><target><green> (<white><rest></white> could not be given due to full inventory)."
command item give success target:
action bar: "<green>Received <white>x<amount> <item></white> heart items."
command item take success: "<green>Removed <white>x<amount> <item></white> heart item from <white><target><green> (<white><rest></white> could not be removed due to not having enough)."
command item take success target:
action bar: "<red>Lost <white>x<amount> <item></white> heart items."
# For the duration placeholder check https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/DurationFormatUtils.html for usage and more examples
command item list header: "<green>Heart items list (<white><amount></white>):"
command item list item: " <white>'<item>' <gray>-</gray> <amount><heart> <itemstack>"
command ban success: "<green>Force banned <white><target></white> for <white><duration:short></white> (will be unbanned at: <white><date:'yyyy-MM-dd HH:mm:ss'></white>)."
command unban success: "<green>Unbanned <white><target></white>."
command unban not banned: "<red><white><target></white> is not banned."
command user info: "<green>User info for <white><player></white>:<newline>
<white>- <green>Hearts: <white><hearts><heart><newline>
<white>- <green>Ban status: <banned:'<white>Not banned</white>':'<red>Will be unbanned in <white><remaining:short></white> (at <white><date:'yyyy-MM-dd HH'h'mm'm'ss's''></white>)</red>'><newline>
<white>- <green>Rules:<newline>
<white>- <green>Max Hearts: <white><online:'<hover:show_text:'Not online'><gray>???':'<permissionmaxhearts><heart>'> <dark_gray>(permission)</dark_gray> + <modifiermaxhearts><heart> <dark_gray>(modifier)</dark_gray> = <online:'<hover:show_text:'Not online'><gray>???':'<maxhearts><heart>'><newline>
<white>- <green>Min Hearts: <white><online:'<hover:show_text:'Not online'><gray>???':'<permissionminhearts><heart>'> <dark_gray>(permission)</dark_gray> + <modifierminhearts><heart> <dark_gray>(modifier)</dark_gray> = <online:'<hover:show_text:'Not online'><gray>???':'<minhearts><heart>'><newline>
<white>- <green>Ban Time: <white><online:'<hover:show_text:'Not online'><gray>???':'<permissionbantime:short>'> <dark_gray>(permission)</dark_gray> + <modifierbantime:short> <dark_gray>(modifier)</dark_gray> = <online:'<hover:show_text:'Not online'><gray>???':'<bantime:short>'><newline>
<white>- <green>Return Hearts: <white><online:'<hover:show_text:'Not online'><gray>???':'<permissionreturnhearts><heart>'> <dark_gray>(permission)</dark_gray> + <modifierreturnhearts><heart> <dark_gray>(modifier)</dark_gray> = <online:'<hover:show_text:'Not online'><gray>???':'<returnhearts><heart>'>"
command user hearts set success: "<green>Set <white><target><green>'s hearts to <white><new><heart><green> (old: <white><previous><heart><green>)."
command user hearts set success target:
sound: minecraft:entity.player.levelup
command user hearts add success: "<green>Added <white><added><green><heart> to <white><target><green> (new: <white><new><heart><green>, old: <white><previous><heart><green>)."
command user hearts add success target:
sound:
key: minecraft:entity.player.levelup
volume: 0.5
pitch: 0.2
command user hearts remove success: "<green>Removed <white><removed><green><heart> from <white><target><green> (new: <white><new><heart><green>, old: <white><previous><heart><green>)."
command user hearts remove success target:
sound: minecraft:entity.player.hurt
command user set rule modifier success: "<green>Set <white><target></white>'s rule modifier <white><rule></white> to <white><value></white>."
command user set rule modifier success target: [ ]
command user adjust rule modifier success: "<green>Adjusted <white><target></white>'s rule modifier <white><rule></white> by <white><adjustment></white>."
command user adjust rule modifier success target: [ ]
command user reset rule modifiers success: "<green>Reset <white><target></white>'s rule modifiers."
command user reset rule modifiers success target: [ ]
consume heart success:
action bar: "<white>+<amount><heart>"
sound: minecraft:entity.player.levelup
particle:
type: "HEART" # List of particles: https://jd.papermc.io/paper/1.21.4/org/bukkit/Particle.html
count: 10 # The amount of particles to spawn
offset x: 0.5 # The maximum random offset between the player eye location and the spawned particle on the X axis
offset y: 1 # ... Y axis
offset z: 0.5 # ... Z axis
consume heart already full:
action bar: "<red>You can't consume any more hearts."
sound: minecraft:entity.villager.no
consume heart overflow not sneaking:
action bar: "<red>Consuming this heart item will exceed your max hearts, wasting <white><overflow></white><heart> extra. Sneak to use it anyway."
sound: minecraft:entity.villager.no
command error retrieving user: "<red>Could not retrieve target user. Check console for more information. Database unreachable?"
command reload success: "<green>Configuration reloaded."
command reload error: "<red>There was an error while reloading the configuration. Check console for more information. The plugin will run with the old configuration."
command storage import success: "<green>Imported <white><imported></white> users from <white><path></white>. Restart the server to load the new users."
command storage import error: "<red>An error occurred while importing users to <white><path></white>: <error>\nCheck the console for more details."
command storage export success: "<green>Exported <white><exported></white> users to <white><path></white>."
command storage export error: "<red>An error occurred while exporting users to <white><path></white>: <error>\nCheck the console for more details."