PVP Toggle
一款适用于 1.20+ 的 PVP 开关插件:玩家可选择是否参与 PVP;管理员可管理他人的状态。支持 Folia、LuckPerms、PlaceholderAPI,以及按世界独立设置 PVP 状态。
功能
- 玩家:使用
/pvp 或 /pvp on / off / toggle 切换自己的 PVP 状态
- 管理员:使用
/pvp on|off|toggle <player> 管理其他玩家的 PVP
- 状态查看:使用
/pvp status 查看自己的状态,使用 /pvp status <player> 查看他人状态(需权限)
- 重载配置:使用
/pvp reload 重载配置文件(需权限)
- 按世界独立:可选为每个世界存储独立的 PVP 状态
- 防抖保存:减少磁盘写入次数
- 冷却时间:切换自身 PVP 后可配置的冷却时间
- 反馈效果:切换时可配置的音效、ActionBar 和 Title 提示
- PlaceholderAPI:提供如
%pvptoggle_status% 等占位符
- Folia:支持区域感知调度;异步保存以避免阻塞
- LuckPerms:安装后由 LuckPerms 处理权限
命令
| 命令 |
描述 |
权限 |
/pvp |
等同于 /pvp toggle;切换你的 PVP 状态 |
pvptoggle.use |
/pvp on |
启用你自己的 PVP |
pvptoggle.use |
/pvp off |
禁用你自己的 PVP |
pvptoggle.use |
/pvp toggle |
切换你的 PVP 状态 |
pvptoggle.use |
/pvp status |
查看你自己的 PVP 状态 |
pvptoggle.use |
/pvp status <player> |
查看其他玩家的 PVP 状态 |
pvptoggle.status.other |
/pvp on|off|toggle <player> |
设置其他玩家的 PVP 状态 |
pvptoggle.admin |
/pvp reload |
重载 config.yml |
pvptoggle.reload |
权限
| 权限 |
描述 |
默认值 |
pvptoggle.use |
使用 /pvp、on/off/toggle 以及 /pvp status (自己) |
true |
pvptoggle.admin |
使用 /pvp on|off|toggle <player> |
op |
pvptoggle.reload |
使用 /pvp reload |
op |
pvptoggle.status.other |
使用 /pvp status <player> |
op |
config.yml
- default-pvp: 新玩家或未知玩家的默认 PVP 状态 (true/false)
- persist-on-rejoin: 玩家重新加入时是否保留其选择的状态
- per-world: 是否按世界存储 PVP 状态(各世界独立)
- save-debounce-seconds: 写入磁盘前的防抖延迟秒数;设为 0 表示每次立即保存
- command-cooldown-seconds: 切换自身 PVP 后的冷却时间秒数;设为 0 表示无冷却
- toggle-feedback: 切换时的反馈效果
- play-sound: 播放音效
- sound: 音效名称(例如 ENTITY_EXPERIENCE_ORB_PICKUP)
- sound-volume / sound-pitch: 音量和音调
- use-actionbar: 在 ActionBar 显示消息
- actionbar-message: ActionBar 文本;
%status% = on/off
- use-title: 显示标题
- title / subtitle: 标题和副标题;
%status% = on/off
- placeholder-on / placeholder-off: PlaceholderAPI 占位符返回的值
- messages.*: 所有消息;支持
& 颜色代码以及 %player%、%seconds%、%status%
PlaceholderAPI
安装 PlaceholderAPI 后,将注册以下占位符(返回值可在配置中更改):
| 占位符 |
描述 |
%pvptoggle_status% |
当前玩家的 PVP 状态(在该玩家的上下文中) |
%pvptoggle_status_<player>% |
特定玩家的 PVP 状态(例如 %pvptoggle_status_Steve%) |
默认返回值为 on / off;可通过配置文件中的 placeholder-on 和 placeholder-off 进行更改。
兼容性
- 服务器端: Paper 1.21+(或兼容分支)
- Folia: 支持 (
folia-supported: true);使用 AsyncScheduler 进行保存
- LuckPerms: 软依赖;存在时由 LuckPerms 管理权限
- PlaceholderAPI: 软依赖;存在时注册占位符
PVP Toggle
A 1.20+ PVP toggle plugin: players choose whether to participate in PVP; admins can manage others’ state. Supports Folia, LuckPerms, PlaceholderAPI, and per-world PVP state.
Features
- Players:
/pvp or /pvp on / off / toggle to change your own PVP
- Admins:
/pvp on|off|toggle <player> to manage someone else’s PVP
- Status:
/pvp status for yourself, /pvp status <player> for others (with permission)
- Reload:
/pvp reload to reload config (with permission)
- Per-world: Optional separate PVP state per world
- Debounced save: Fewer disk writes
- Cooldown: Configurable cooldown after toggling your own PVP
- Feedback: Configurable sound, ActionBar, and Title on toggle
- PlaceholderAPI: Placeholders like
%pvptoggle_status%
- Folia: Region-aware scheduling; async save so it doesn’t block
- LuckPerms: Permissions handled by LuckPerms when installed
Commands
| Command |
Description |
Permission |
/pvp |
Same as /pvp toggle; toggles your PVP |
pvptoggle.use |
/pvp on |
Enable PVP for yourself |
pvptoggle.use |
/pvp off |
Disable PVP for yourself |
pvptoggle.use |
/pvp toggle |
Toggle your PVP |
pvptoggle.use |
/pvp status |
View your own PVP status |
pvptoggle.use |
/pvp status <player> |
View another player’s PVP status |
pvptoggle.status.other |
/pvp on|off|toggle <player> |
Set PVP for another player |
pvptoggle.admin |
/pvp reload |
Reload config.yml |
pvptoggle.reload |
Permissions
| Permission |
Description |
Default |
pvptoggle.use |
Use /pvp, on/off/toggle, and /pvp status (self) |
true |
pvptoggle.admin |
Use /pvp on|off|toggle <player> |
op |
pvptoggle.reload |
Use /pvp reload |
op |
pvptoggle.status.other |
Use /pvp status <player> |
op |
config.yml
- default-pvp: Default PVP state for new or unknown players (true/false)
- persist-on-rejoin: Whether to keep each player’s choice when they rejoin
- per-world: Whether to store PVP state per world (separate per world)
- save-debounce-seconds: Debounce time in seconds before writing to disk; 0 = save every time
- command-cooldown-seconds: Cooldown in seconds after toggling your own PVP; 0 = no cooldown
- toggle-feedback: Feedback when toggling
- play-sound: Play a sound
- sound: Sound name (e.g. ENTITY_EXPERIENCE_ORB_PICKUP)
- sound-volume / sound-pitch: Volume and pitch
- use-actionbar: Show message in ActionBar
- actionbar-message: ActionBar text;
%status% = on/off
- use-title: Show title
- title / subtitle: Title and subtitle;
%status% = on/off
- placeholder-on / placeholder-off: Values returned by PlaceholderAPI placeholders
- messages.*: All messages; supports
& color codes and %player%, %seconds%, %status%
PlaceholderAPI
With PlaceholderAPI installed, these placeholders are registered (return values are configurable):
| Placeholder |
Description |
%pvptoggle_status% |
Current player’s PVP status (in that player’s context) |
%pvptoggle_status_<player>% |
A specific player’s PVP status (e.g. %pvptoggle_status_Steve%) |
Default return values are on / off; change them with placeholder-on and placeholder-off in config.
Compatibility
- Server: Paper 1.21+ (or compatible forks)
- Folia: Supported (
folia-supported: true); uses AsyncScheduler for saves
- LuckPerms: Soft dependency; permissions are managed by LuckPerms when present
- PlaceholderAPI: Soft dependency; placeholders are registered when present
评论 0
登录后参与评分
还没有评论,来抢沙发吧