❤️ LifeEconomy — 以心为币。真实的 SMP 风险。
是否想过使用生命值作为货币?
是否想过让玩家流失力量、为生命值而战,并将 HP 当作经济属性来炫耀?
欢迎来到 LifeEconomy —— 一款适用于 SMP(生存多人游戏)的类掠夺生命值的经济系统,其中:
- 生命值即金钱
- 死亡带来真实后果
- PvP 就是利润
- 生存 = 策略
将你的服务器转变为一个真正的高风险 SMP 经济环境,玩家必须通过 literally “流血”来获取财富。
✅ 功能特性
- 持久化存储生命值(数据库)✅
- 死亡时扣除生命值 ✅
- 击杀时窃取生命值 ✅
- 最低生命值保护 ✅
- 兼容 Folia ✅
- 支持 SQLite ✅
- 支持 MySQL ✅
- 动作栏显示生命值 ✅
- 全配置项可定制 ✅
- 开发者 API ✅
- 排行榜 ?
- PlaceholderAPI 支持 ✅
- 无生命值物品 ❌(直接的生命值经济,无掉落物)
LifeEconomy 是一个核心插件,单独安装时功能有限。为了提升你的 LifeEconomy 体验,建议向服务器添加以下附加组件。
?️ 可用附加组件
? PlaceholderAPI 占位符 (点击展开)
| 占位符 |
描述 |
示例输出 |
%life_health% |
显示玩家的原始生命值数值(内部 HP,非红心数) |
36.0 |
%life_hearts% |
显示玩家的红心数量 |
18 |
%life_hearts_formatted% |
带符号和倍数的红心显示 |
❤ x18 |
%life_percentage% |
玩家健康值占默认值(20 HP)的百分比 |
180% |
%life_min_health% |
插件配置的最低生命值 |
2.0 |
%life_can_lose% |
玩家在达到最低生命值前可失去的红心数 |
16 |
%life_is_min_health% |
如果玩家处于最低生命值则返回 true |
false |
%life_bar% |
跨多行的生命值条 UI(每行 10 颗心,MiniMessage → Legacy 转换)** |
❤❤❤❤❤❤❤❤❤❤
❤❤❤❤❤❤❤❤❤❤ |
%life_rank% |
即将推出的排行榜支持的占位符 |
Coming soon |
%life_top_1% |
即将推出的榜首玩家名称支持的占位符 |
Coming soon |
%life_top_1_hearts% |
即将推出的榜首玩家生命值支持的占位符 |
Coming soon |
注意: %life_bar% 支持多行红心,因此在支持换行的记分板和 GUI 中显示效果极佳。
⚙️ 配置预览 (点击展开)
database: #使用 mysql 以在代理网络的不同服务器间同步生命值
type: sqlite #或 "mysql" 如果你尚未设置 mysql 服务器,请使用 sqlite
# SQLite 选项
file: hearts.db
# MySQL 选项(仅在 type = mysql 时使用)
host: localhost
port: 3306
database: life_economy
username: root
password: ""
useSSL: false
pool-size: 10
cost: #1 颗心 = 2.0 生命值点
minimum-health: 2.0 #玩家最低生命值,死亡不会导致生命值低于此值(建议不要更改,2.0 相当于 1 颗心)
random-death: 2.0 #当玩家因非玩家原因死亡时,仅删除 1 颗心。
death-to-player: 2.0 #如果被玩家杀死,消耗 1 颗心(转移给击杀者)
settings: #受伤时显示红心
heal-on-kill: true
hearts-display: ACTION_BAR #如果不希望显示红心,请输入 none。目前仅支持 ACTION_BAR
display-timeout: 4 #显示消失前的秒数
messages:
no-hearts-lost: "<red>You didn't lose any hearts.</red>"
no-hearts-gained: "<red>You didn't gain any hearts.</red>"
pay: "<gray>You gave <gold>{target}</gold><green> {amount} <red>health"
player-not-found: "<red>That player does not exist or is not online!"
pay-more-than-minimum: "<red>Cannot send if it results in you having less than {minimum} health!"
pay-more-than-health: "<red>You're trying to pay more than what you have!"~~~~
? 命令
-
所有 /life 命令 - (life.admin)
-
/life give <player> <health> - 给予生命值
-
/life take <player> <health> - 移除生命值
-
/life set <player> <health> - 设置生命值
-
/life reload - 重载配置
-
/health pay <amount> <player> - 将自己的生命值给予其他玩家。(life.health)
⚠️ 1 颗心 = 2 点生命值。
? 开发者 API
创建基于生命的玩法系统:
- 生命值商店
- 任务奖励
- Boss 生命值掉落
- PvP 系统
- 可制作的心之物品
- 经济转换
Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.jollyjoee</groupId>
<artifactId>LifeEconomy</artifactId>
<version>[1.0,)</version> <!-- 始终使用最新版本 >= 1.0 -->
<scope>provided</scope>
</dependency>
Gradle
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.jollyjoee:LifeEconomy:[1.0,)'
}
API 使用示例
import com.jolly.lifeEconomy.LifeEconomyAPI;
import com.jolly.lifeEconomy.LifeEconomy;
import org.bukkit.entity.Player;
```java
public class Example {
public static LifeEconomyAPI api;
@Override
public void onEnable() {
if (!Bukkit.getPluginManager().isPluginEnabled("LifeEconomy")) {
getLogger().severe("❌ 未找到 LifeEconomy!正在禁用插件。");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
LifeEconomy lifeEconomyPlugin = (LifeEconomy) getServer().getPluginManager().getPlugin("LifeEconomy");
if (lifeEconomyPlugin == null) {
getLogger().severe("未安装 LifeEconomy!");
getServer().getPluginManager().disablePlugin(this);
return;
}
api = lifeEconomyPlugin.getAPI();
if (api == null) {
getLogger().severe("获取 LifeEconomy API 实例失败!");
getServer().getPluginManager().disablePlugin(this);
return;
}
getLogger().info("✅ 成功接入 LifeEconomy API!");
}
}
Api 方法
// 增加 1 颗心并治疗
api.giveHealth(player, 2.0, true);
// 移除半颗心
api.takeHealth(player, 1.0);
// 设置精确的生命值
api.setHealth(player, 40.0);
// 获取生命值
double health = api.getHealth(player)
?️ 完美适用于
- 生命窃取 SMP(Lifesteal SMP)
- 硬核经济服务器
- 带有赌注的 PvP 竞技场
- 力量与生命值挂钩的阵营/氏族
- 自定义生存 RPG SMP
? 为什么选择 LifeEconomy?
与典型的生命窃取插件不同,这是一个真正的基于生命值经济系统,旨在扩展而非模仿。
竞争性。稀缺性。可刷取。可交易。
心的财富 = 力量。
让血液经济崛起吧。??
⚙️ 安装步骤
- 下载 LifeEconomy
- 下载 PlaceholderAPI for Folia
- 将 LifeEconomy.jar 和 PlaceholderAPI.jar 安装到你的 plugins 文件夹中
❤️ LifeEconomy — Hearts as Currency. Real SMP Stakes.
Ever wanted to use hearts as a currency?
Ever wanted players to bleed power, fight for hearts, and flex HP like an economy stat?
Welcome to LifeEconomy — a lifesteal-inspired heart economy system for SMPs where:
- Hearts are money
- Deaths have real consequences
- PvP is profit
- Survival = strategy
Turn your server into a true high-stakes SMP economy where players literally grind blood for wealth.
✅ Features
- Persistent hearts (DB) ✅
- Lose hearts on death ✅
- Steal hearts on kill ✅
- Minimum heart safety ✅
- Folia compatible ✅
- SQLite ✅
- MySQL ✅
- Action Bar hearts display ✅
- Configurable everything ✅
- Developer API ✅
- Leaderboard ?
- PlaceholderAPI ✅
- Heart items ❌ (Direct health economy, no drops)
LifeEconomy is a Core-plugin, it's features are limited if installed by itself. To enhance your LifeEconomy experience, consider adding these add-ons to your server.
?️ Available add-ons
- LifeEconomy-Shop
- Other developers are welcome to send me their add-ons on my discord server! (Click the link on the page's sidebar)
? PlaceholderAPI Placeholders (click to expand)
| Placeholder |
Description |
Example Output |
%life_health% |
Shows the player's raw health value (internal HP, not hearts) |
36.0 |
%life_hearts% |
Shows the player's hearts count |
18 |
%life_hearts_formatted% |
Displays hearts with a symbol & multiplier |
❤ x18 |
%life_percentage% |
Player health as a percentage of default (20 HP) |
180% |
%life_min_health% |
Minimum health configured in the plugin |
2.0 |
%life_can_lose% |
How many hearts the player can lose before reaching minimum |
16 |
%life_is_min_health% |
Returns true if the player is at minimum health |
false |
%life_bar% |
Heart bar UI across multiple lines (10 hearts per row, MiniMessage → Legacy converted)** |
❤❤❤❤❤❤❤❤❤❤
❤❤❤❤❤❤❤❤❤❤ |
%life_rank% |
Placeholder for upcoming leaderboard support |
Coming soon |
%life_top_1% |
Placeholder for upcoming top player name support |
Coming soon |
%life_top_1_hearts% |
Placeholder for upcoming top player hearts support |
Coming soon |
Note: %life_bar% supports multiline hearts, so looks great in scoreboards & GUIs that support newlines.
⚙️ Config Preview (click to expand)
database: #use mysql to sync hearts across different servers on a proxy network
type: sqlite # or "mysql" use sqlite if you haven't set up a mysql server
# SQLite options
file: hearts.db
# MySQL options (used only if type = mysql)
host: localhost
port: 3306
database: life_economy
username: root
password: ""
useSSL: false
pool-size: 10
cost: #1 heart = 2.0
minimum-health: 2.0 #Minimum player health, no death will cause health to go below this (I suggest not changing this, 2.0 is 1 heart)
random-death: 2.0 #Just deletes 1 heart when a player dies from any other causes that's not a player.
death-to-player: 2.0 #1 heart cost if they die to a player (gets transferred to killer)
settings: #hearts-display appear on damage
heal-on-kill: true
hearts-display: ACTION_BAR #type none if you don't want a hearts display. ACTION_BAR is the only supported display for now
display-timeout: 4 #Seconds before display disappears
messages:
no-hearts-lost: "<red>You didn't lose any hearts.</red>"
no-hearts-gained: "<red>You didn't gain any hearts.</red>"
pay: "<gray>You gave <gold>{target}</gold><green> {amount} <red>health"
player-not-found: "<red>That player does not exist or is not online!"
pay-more-than-minimum: "<red>Cannot send if it results in you having less than {minimum} health!"
pay-more-than-health: "<red>You're trying to pay more than what you have!"~~~~
? Commands
-
All /life commands - (life.admin)
-
/life give <player> <health> - Give health
-
/life take <player> <health> - Remove health
-
/life set <player> <health> - Set health
-
/life reload - Reload config
-
/health pay <amount> <player> - Give another player your health. (life.health)
⚠️ 1 heart = 2 health points.
? Developer API
Create heart-based gameplay systems:
- Heart shops
- Quest rewards
- Boss heart drops
- PvP systems
- Craftable hearts
- Economy conversion
Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.jollyjoee</groupId>
<artifactId>LifeEconomy</artifactId>
<version>[1.0,)</version> <!-- always use newest >= 1.0 -->
<scope>provided</scope>
</dependency>
Gradle
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.jollyjoee:LifeEconomy:[1.0,)'
}
API Usage Example
import com.jolly.lifeEconomy.LifeEconomyAPI;
import com.jolly.lifeEconomy.LifeEconomy;
import org.bukkit.entity.Player;
public class Example {
public static LifeEconomyAPI api;
@Override
public void onEnable() {
if (!Bukkit.getPluginManager().isPluginEnabled("LifeEconomy")) {
getLogger().severe("❌ LifeEconomy not found! Disabling plugin.");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
LifeEconomy lifeEconomyPlugin = (LifeEconomy) getServer().getPluginManager().getPlugin("LifeEconomy");
if (lifeEconomyPlugin == null) {
getLogger().severe("LifeEconomy is not installed!");
getServer().getPluginManager().disablePlugin(this);
return;
}
api = lifeEconomyPlugin.getAPI();
if (api == null) {
getLogger().severe("Failed to get LifeEconomy API instance!");
getServer().getPluginManager().disablePlugin(this);
return;
}
getLogger().info("✅ Successfully hooked into LifeEconomy API!");
}
}
Api Methods
// +1 heart and heal
api.giveHealth(player, 2.0, true);
// remove half a heart
api.takeHealth(player, 1.0);
// set exact health
api.setHealth(player, 40.0);
// get health
double health = api.getHealth(player)
?️ Perfect For
- Lifesteal SMPs
- Hardcore economy servers
- PvP arenas with stakes
- Factions/Clans with power tied to health
- Custom survival RPG SMPs
? Why LifeEconomy?
Unlike typical lifesteal plugins, this is a true health-based economy system designed to expand — not imitate.
Competitive. Scarce. Grindable. Tradable.
Heart wealth = power.
Let the blood economy rise. ??
⚙️ Installation Steps
- Download LifeEconomy
- Download PlaceholderAPI for Folia
- Install LifeEconomy.jar and PlaceholderAPI.jar into your plugins folder
评论 0
登录后参与评分
还没有评论,来抢沙发吧