LivesPlugin
每位玩家都拥有若干条生命。每次有人击杀你,你就会失去一条生命。当最后一条生命也失去时,你将被淘汰(被封禁或作为旁观者卡住),直到有其他玩家使用复活书将你带回游戏。
我制作这个插件是为了适用于那些死亡应当具有实际意义的 SMP 服务器和活动,但又不希望一次糟糕的战斗就终结某人的一整季体验。几乎所有内容都可以在配置文件中修改。
工作原理
- 新玩家初始拥有 3 条生命(你可以自定义数量)。
- 被其他玩家击杀会消耗一条生命。你也可以设置让每次死亡都计数。
- 击杀者会获得一条生命,或者如果其生命值已满,则会获得一颗生命之星。
- 当生命值为 0 时,你将被淘汰:要么被封禁,要么保持在在线状态作为旁观者。
- 好友制作一本复活书,右键点击并从菜单中选择你。你将以 1 条生命的状态回归。
功能
- 封禁或旁观者淘汰模式。旁观者可以观看但不能离开旁观者模式或打开箱子
- 复活书包含所有被淘汰玩家的列表,按名称排序并显示他们的皮肤
- 生命之星:可以制作、交易,或使用
/withdrawlife 将自己的生命转化为生命之星
- 标签页列表中显示生命数量或心形图标,并根据剩余数量变色
- 不同权限组可拥有不同的最大生命值,使用
livesplugin.maxlives.<n>。配合 LuckPerms 使用时会立即更新
- 可通过
/livesrecipe 命令或在 config.yml 中更改两种配方
- 支持将数据保存到文件、SQLite 或 MySQL。使用 MySQL 时多个服务器可以共享同一份生命数据
- 支持 PlaceholderAPI,且聊天消息可在 messages.yml 中重新措辞或重着色(支持十六进制颜色码)
- 有新版本时会通知你
命令
| 命令 |
作用 |
权限 |
/lives [player] |
显示你的生命数,或他人的生命数 |
无 |
/withdrawlife <amount> |
将生命转化为生命之星(始终保留 1 条生命) |
livesplugin.withdrawlife |
/livesplugin set <player> <amount> |
设置某人的生命数。设为 0 即淘汰,高于 0 则复活 |
livesplugin.set |
/livesplugin add <player> <amount> |
给予生命 |
livesplugin.add |
/livesplugin remove <player> <amount> |
扣除生命 |
livesplugin.remove |
/livesplugin revive [player] |
复活某人,或打开复活菜单 |
livesplugin.revive |
/livesplugin give <revivebook|lifestar> [player] [amount] |
给予物品 |
livesplugin.give |
/livesrecipe |
打开配方编辑器 |
livesplugin.recipe |
/livesplugin reload |
重新加载 config.yml 和 messages.yml |
livesplugin.reload |
除 /lives 和 /withdrawlife 外,其余命令默认仅限 OP 使用。
所有权限
livesplugin.withdrawlife: 使用 /withdrawlife(默认所有人可用)
livesplugin.set, livesplugin.add, livesplugin.remove: 修改生命值
livesplugin.revive: 无需复活书即可复活他人
livesplugin.give: 给予复活书和生命之星
livesplugin.recipe: 使用配方编辑器
livesplugin.reload: 重新加载配置文件
livesplugin.update: 加入服务器时接收更新通知
livesplugin.admin: 在被淘汰状态下退出旁观者模式,防止工作人员被困住
livesplugin.maxlives.<n>: 设置不同的最大生命值上限,例如 livesplugin.maxlives.10。取最高值生效
livesplugin.*: 拥有以上所有权限
占位符 (PlaceholderAPI)
%livesplugin_lives% 和 %livesplugin_lives_colored%
%livesplugin_max_lives%
%livesplugin_hearts% 和 %livesplugin_hearts_colored%
%livesplugin_eliminated% (true/false)
%livesplugin_starting_lives%
%livesplugin_eliminated_count%
config.yml
# ──────────────────────────────────────────────────────────────
# ♥ LivesPlugin 配置
# 此处列出的所有选项均由插件使用 - 未列出的选项不存在。
# 拼写错误和无效值会在启动时及执行 /livesplugin reload 时在控制台中报告。
#
# Discord: https://discord.gg/Ha3FHZBX5Q
# ──────────────────────────────────────────────────────────────
# 不要更改此项 - 它告诉 LivesPlugin 此文件的布局版本。
config-version: 2
# ──────────────────────────────────────────────────────────────
# ♥ 生命值
# ──────────────────────────────────────────────────────────────
# 全新玩家加入时的初始生命值
starting-lives: 3
# 任何人能拥有的最大生命值。个别玩家或权限组可以通过权限 livesplugin.maxlives.<n>
# (例如 livesplugin.maxlives.10)获得不同的上限 - 取他们拥有的最高值生效。
max-lives: 5
# 复活后玩家恢复的生命值数量
revive-lives: 1
# true: 仅死于其他玩家才会消耗生命值。
# false: 每次死亡(跌落伤害、岩浆、怪物攻击等)都会消耗生命值。
lose-life-on-pvp-only: true
# 击杀其他玩家会让击杀者获得生命值。超过击杀者最大值的部分将作为
# 生命之星物品给予(如果启用了生命之星)。
give-life-on-kill: true
give-life-on-kill-amount: 1
# ──────────────────────────────────────────────────────────────
# ♥ 淘汰机制 - 生命值为 0 时发生什么
# ──────────────────────────────────────────────────────────────
淘汰:
# BAN(封禁):玩家被踢出服务器,直到被复活前无法重新加入。
# SPECTATOR(旁观者):玩家保持在在线状态并处于旁观者模式,直到
# 被复活。他们可以观看,但不能离开旁观者模式
# 或查看容器内部。
# 从 BAN 切换到 SPECTATOR 允许已被淘汰的玩家
# 以旁观者身份重新加入。
mode: BAN
spectator:
# 当旁观者被复活时,将其传送至复活他们的玩家身边。如果为 false(或由命令复活),他们将被传送到
# 世界出生点——绝不会让他们停留在之前观看的位置悬空。
teleport-to-reviver-on-revive: true
# ──────────────────────────────────────────────────────────────
# ♥ 标签页列表 (Tab List)
# ──────────────────────────────────────────────────────────────
tab-display:
# 在标签页列表中名字旁边显示剩余生命数。如果
# 另一个插件管理标签页名称,请关闭此选项。
enabled: true
# 占位符:%player%、%lives%、%max%、%color% 和 %hearts%
# (每个 ❤ 代表一条命)。支持 &-颜色代码和 &#RRGGBB 十六进制颜色。
format: '%color%%player% &7[%color%%lives%&7]'
# %color% 取决于玩家生命值的充盈程度:
colors:
full: '&a' # 满值
high: '&a' # 67% 或以上
medium: '&e' # 34% - 66%
low: '&c' # 低于 34%
# ──────────────────────────────────────────────────────────────
# ♥ 复活书 - 右键点击以复活一名被淘汰的玩家
# ──────────────────────────────────────────────────────────────
revive-book:
enabled: true
item:
name: '&6复活书'
lore:
- '&7右键点击复活一名'
- '&7已被淘汰的玩家!'
recipe:
# 3x3 合成台配方,从上到下排列。空格表示空槽位。
shape:
- ABA
- BCB
- ABA
# 每个字母代表的物品:可以是任何物品名称,或者 LIFE_STAR 代表
# 生命之星物品本身。
ingredients:
A: NETHERITE_INGOT
B: TOTEM_OF_UNDYING
C: LIFE_STAR
# ──────────────────────────────────────────────────────────────
# ♥ 生命之星 - 右键点击以获得一条生命
# ──────────────────────────────────────────────────────────────
life-star:
# 同时也控制 /withdrawlife 命令以及击杀掉落的生命之星。
enabled: true
# 每个生命之星提供的生命数(不超过玩家的最大生命值)
lives-granted: 1
crafting-limit:
# 当玩家当前剩余最大生命值以下或等于该数值时,阻止玩家合成生命之星。
# 不影响 /livesplugin give 命令。
enabled: false
max-lives: 5
item:
name: '&d生命之星'
lore:
- '&7右键点击获得额外一条命!'
- '&7谨慎使用,它们非常稀有!'
recipe:
shape:
- ABA
- BCB
- ABA
ingredients:
A: DIAMOND_BLOCK
B: NETHERITE_INGOT
C: NETHER_STAR
# ──────────────────────────────────────────────────────────────
# ♥ 音效
# ──────────────────────────────────────────────────────────────
# sound: 任意音效名称,例如 ENTITY_ENDER_DRAGON_GROWL
# scope: 谁可以听到它 -
# PLAYER:只有当事玩家能听到
# NEARBY:在其 `radius` 格范围内的玩家
# WORLD:其所在世界的所有人
# SERVER:所有在线玩家
sounds:
elimination:
enabled: true
sound: ENTITY_ENDER_DRAGON_GROWL
volume: 1.0
pitch: 0.5
scope: SERVER
radius: 32
revive:
enabled: true
sound: ENTITY_FIREWORK_ROCKET_BLAST
volume: 1.0
pitch: 1.0
scope: SERVER
radius: 32
# ──────────────────────────────────────────────────────────────
# ♥ 存储设置 - 修改此处需重启生效
# ──────────────────────────────────────────────────────────────
storage:
# YAML:单个文件 lives-data.yml。简单;适用于大多数服务器。
# SQLITE:本地数据库文件。更适合玩家数量非常多的情况。
# MYSQL:MySQL/MariaDB 服务器。允许多个服务器共享生命值数据。
# 从 YAML 切换到 SQLITE/MYSQL 会在第一次启动时自动迁移所有人的数据(当数据库为空时)。
type: YAML
# 后台保存更改的频率,单位为秒。
# 关闭服务器时也会保存所有数据。
save-interval-seconds: 30
# 数据库表名前缀(SQLITE 和 MYSQL)
table-prefix: 'livesplugin_'
sqlite:
file: 'lives.db'
mysql:
host: 'localhost'
port: 3306
database: 'minecraft'
username: 'root'
password: ''
# 额外的连接选项
properties: 'useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8'
# ──────────────────────────────────────────────────────────────
# ♥ 更新检查器与指标统计
# ──────────────────────────────────────────────────────────────
update-checker:
# 在启动时及每 12 小时检查 Modrinth 上的新版本发布
# 并在控制台输出提示。
enabled: true
# 当拥有 livesplugin.update 权限的操作员(ops)加入时,也通知他们。
notify-ops: true
metrics:
# 通过 bStats (bstats.org) 发送匿名使用统计数据 - 服务器数量、
# 版本信息以及使用的存储/淘汰模式。修改后需重启生效。
enabled: true
</details>
### 兼容性
- Bukkit, Spigot, Paper, Purpur, Folia 和 Leaf。一个 jar 包兼容所有平台
- Minecraft 1.18 至 26.3 版本
- Java 17 或更高版本
- 可选依赖:PlaceholderAPI, LuckPerms
从 1.3 版本升级?只需替换 jar 包即可。生命数和淘汰状态会保留,并且旧配置文件会先进行备份。
### 帮助与链接
- 问题、错误或建议:[Discord](https://discord.gg/Ha3FHZBX5Q)
- [bStats](https://bstats.org/plugin/bukkit/LivesPlugin/29507)。该插件在此处发送匿名使用统计数据,并检查 Modrinth 以获取更新。您可以在 config.yml 中关闭这两项功能。
版权所有。请勿重新上传或分发此插件。
由 Kai 制作 ❤️
LivesPlugin
Every player gets a few lives. Each time someone kills you, you lose one. Lose the last one and you're eliminated, either banned or stuck watching as a spectator, until another player spends a Revive Book to bring you back.
I made it for SMPs and events where dying should actually matter, but where one bad fight shouldn't end someone's whole season. Pretty much everything can be changed in the config.
How it works
- New players start with 3 lives (you choose the number).
- Getting killed by another player costs a life. You can make every death count instead.
- The killer gets a life back, or a Life Star if they're already full.
- At 0 lives you're eliminated: banned, or kept online as a spectator.
- A friend crafts a Revive Book, right-clicks it and picks you from the menu. You're back with 1 life.
Features
- Ban or spectator elimination. Spectators can watch but can't leave spectator mode or open chests
- Revive Book with a menu of everyone who's out, sorted by name, with their skins
- Life Stars: craft them, trade them, or turn your own lives into them with
/withdrawlife
- Lives in the tab list as a number or as hearts, coloured by how many are left
- Different max lives per rank with
livesplugin.maxlives.<n>. With LuckPerms it updates straight away
- Change both recipes in-game with
/livesrecipe, or in config.yml
- Save to a file, SQLite or MySQL. With MySQL several servers can share the same lives
- PlaceholderAPI support, and chat messages you can reword or recolour (hex works too) in messages.yml
- Tells you when an update comes out
Commands
| Command |
What it does |
Permission |
/lives [player] |
Shows your lives, or someone else's |
none |
/withdrawlife <amount> |
Turns lives into Life Stars (you always keep 1) |
livesplugin.withdrawlife |
/livesplugin set <player> <amount> |
Sets someone's lives. 0 eliminates, above 0 revives |
livesplugin.set |
/livesplugin add <player> <amount> |
Gives lives |
livesplugin.add |
/livesplugin remove <player> <amount> |
Takes lives away |
livesplugin.remove |
/livesplugin revive [player] |
Revives someone, or opens the revive menu |
livesplugin.revive |
/livesplugin give <revivebook|lifestar> [player] [amount] |
Gives items |
livesplugin.give |
/livesrecipe |
Opens the recipe editor |
livesplugin.recipe |
/livesplugin reload |
Reloads config.yml and messages.yml |
livesplugin.reload |
Everything except /lives and /withdrawlife is OP-only by default.
All permissions
livesplugin.withdrawlife: use /withdrawlife (everyone by default)
livesplugin.set, livesplugin.add, livesplugin.remove: change lives
livesplugin.revive: revive without a Revive Book
livesplugin.give: give Revive Books and Life Stars
livesplugin.recipe: the recipe editor
livesplugin.reload: reload the config
livesplugin.update: get told about updates when joining
livesplugin.admin: leave spectator mode while eliminated, so staff don't get stuck
livesplugin.maxlives.<n>: a different max lives, e.g. livesplugin.maxlives.10. The highest one wins
livesplugin.*: all of the above
Placeholders (PlaceholderAPI)
%livesplugin_lives% and %livesplugin_lives_colored%
%livesplugin_max_lives%
%livesplugin_hearts% and %livesplugin_hearts_colored%
%livesplugin_eliminated% (true/false)
%livesplugin_starting_lives%
%livesplugin_eliminated_count%
config.yml
# ──────────────────────────────────────────────────────────────
# ♥ LivesPlugin Configuration
# Every option here is used by the plugin - anything not listed
# doesn't exist. Typos and invalid values are reported in the
# console on startup and on /livesplugin reload.
#
# Discord: https://discord.gg/Ha3FHZBX5Q
# ──────────────────────────────────────────────────────────────
# Don't change this - it tells LivesPlugin which layout this file has.
config-version: 2
# ──────────────────────────────────────────────────────────────
# ♥ Lives
# ──────────────────────────────────────────────────────────────
# What a brand new player joins with
starting-lives: 3
# The most lives anyone can have. Individual players or ranks can
# get a different cap with the permission livesplugin.maxlives.<n>
# (e.g. livesplugin.maxlives.10) - the highest one they have wins.
max-lives: 5
# How many lives a revived player comes back with
revive-lives: 1
# true: only dying to another player costs a life.
# false: every death (fall damage, lava, mobs...) costs a life.
lose-life-on-pvp-only: true
# Killing another player gives the killer lives. Anything above the
# killer's max is given as Life Star items instead (if Life Stars are
# enabled).
give-life-on-kill: true
give-life-on-kill-amount: 1
# ──────────────────────────────────────────────────────────────
# ♥ Elimination - what happens at 0 lives
# ──────────────────────────────────────────────────────────────
elimination:
# BAN: the player is kicked and can't rejoin until revived.
# SPECTATOR: the player stays online in spectator mode until
# revived. They can watch, but not leave spectator mode
# or look inside containers.
# Switching from BAN to SPECTATOR lets already-eliminated players
# rejoin as spectators.
mode: BAN
spectator:
# When a spectator is revived, teleport them to the player who
# revived them. If false (or revived by command), they're sent to
# the world spawn - never left floating where they were watching.
teleport-to-reviver-on-revive: true
# ──────────────────────────────────────────────────────────────
# ♥ Tab List
# ──────────────────────────────────────────────────────────────
tab-display:
# Show lives next to names in the tab list. Turn this off if
# another plugin manages tab names.
enabled: true
# Placeholders: %player%, %lives%, %max%, %color% and %hearts%
# (one ❤ per life). Supports &-codes and &#RRGGBB hex colors.
format: '%color%%player% &7[%color%%lives%&7]'
# %color% depends on how full a player's lives are:
colors:
full: '&a' # at their max
high: '&a' # 67% or more
medium: '&e' # 34% - 66%
low: '&c' # below 34%
# ──────────────────────────────────────────────────────────────
# ♥ Revive Book - right-click to revive an eliminated player
# ──────────────────────────────────────────────────────────────
revive-book:
enabled: true
item:
name: '&6Revive Book'
lore:
- '&7Right-click to revive a player'
- '&7who has been eliminated!'
recipe:
# 3x3 crafting grid, top row first. A space is an empty slot.
shape:
- ABA
- BCB
- ABA
# What each letter stands for: any item name, or LIFE_STAR for
# the Life Star item itself.
ingredients:
A: NETHERITE_INGOT
B: TOTEM_OF_UNDYING
C: LIFE_STAR
# ──────────────────────────────────────────────────────────────
# ♥ Life Star - right-click to gain a life
# ──────────────────────────────────────────────────────────────
life-star:
# Also controls /withdrawlife and Life Stars from kills.
enabled: true
# Lives gained per Life Star (never above the player's max)
lives-granted: 1
crafting-limit:
# Stop players crafting Life Stars once they have max-lives below
# or more. Doesn't affect /livesplugin give.
enabled: false
max-lives: 5
item:
name: '&dLife Star'
lore:
- '&7Right-click to gain an extra life!'
- '&7Use wisely, these are rare!'
recipe:
shape:
- ABA
- BCB
- ABA
ingredients:
A: DIAMOND_BLOCK
B: NETHERITE_INGOT
C: NETHER_STAR
# ──────────────────────────────────────────────────────────────
# ♥ Sounds
# ──────────────────────────────────────────────────────────────
# sound: any sound name, e.g. ENTITY_ENDER_DRAGON_GROWL
# scope: who hears it -
# PLAYER: only the player it happened to
# NEARBY: players within `radius` blocks of them
# WORLD: everyone in their world
# SERVER: everyone online
sounds:
elimination:
enabled: true
sound: ENTITY_ENDER_DRAGON_GROWL
volume: 1.0
pitch: 0.5
scope: SERVER
radius: 32
revive:
enabled: true
sound: ENTITY_FIREWORK_ROCKET_BLAST
volume: 1.0
pitch: 1.0
scope: SERVER
radius: 32
# ──────────────────────────────────────────────────────────────
# ♥ Storage - changes here apply after a restart
# ──────────────────────────────────────────────────────────────
storage:
# YAML: one file, lives-data.yml. Simple; fine for most servers.
# SQLITE: a local database file. Better for very large player counts.
# MYSQL: a MySQL/MariaDB server. Lets several servers share lives.
# Switching from YAML to SQLITE/MYSQL copies everyone over
# automatically the first time (when the database is empty).
type: YAML
# How often changes are saved in the background, in seconds.
# Everything is also saved on shutdown.
save-interval-seconds: 30
# Prefix for database table names (SQLITE and MYSQL)
table-prefix: 'livesplugin_'
sqlite:
file: 'lives.db'
mysql:
host: 'localhost'
port: 3306
database: 'minecraft'
username: 'root'
password: ''
# Extra connection options
properties: 'useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8'
# ──────────────────────────────────────────────────────────────
# ♥ Update Checker & Metrics
# ──────────────────────────────────────────────────────────────
update-checker:
# Check Modrinth for new releases (on startup, then every 12 hours)
# and mention them in the console.
enabled: true
# Also tell players with livesplugin.update (ops) when they join.
notify-ops: true
metrics:
# Anonymous usage statistics via bStats (bstats.org) - server count,
# versions, and which storage/elimination mode is used. Applies
# after a restart.
enabled: true
Compatibility
- Bukkit, Spigot, Paper, Purpur, Folia and Leaf. One jar for all of them
- Minecraft 1.18 up to 26.3
- Java 17 or newer
- Optional: PlaceholderAPI, LuckPerms
Coming from 1.3? Just swap the jar. Lives and eliminations carry over, and your old files are backed up first.
Help and links
- Questions, bugs or ideas: Discord
- bStats. The plugin sends anonymous usage stats there and checks Modrinth for updates. You can turn both off in config.yml
All Rights Reserved. Please don't re-upload or redistribute the plugin.
Made by Kai ❤️
评论 0
登录后参与评分
还没有评论,来抢沙发吧