Player Utils
一款针对 NeoForge 1.21.1 的强大管理模组,添加了四个用于控制游戏的关键命令。
✨ 特性
- /choke – 强制玩家窒息,除非满足特定的物品栏条件。
氧气会迅速耗尽并在为空时造成伤害。条件是可选的。
- /health – 将玩家的生命值锁定为固定值(1–100),直到满足条件为止。
支持可选的物品栏条件。
- /pvp – 禁用玩家攻击其他玩家的能力。
简单的开关切换。
- /autosp – 死亡后自动将你的重生点设置为死亡位置。
点击重生按钮即可在死亡的确切位置重生。
所有状态均持久化保存在每个玩家的 NBT 数据中,服务器重启和重新登录后依然保留。
? 命令参考
/choke
| 子命令 |
语法 |
描述 |
start |
/choke start <targets> [slotList] |
开始对目标玩家施加窒息效果。如果省略 slotList,则该效果为无条件(始终生效)。 |
stop |
/choke stop [targets] |
停止该效果。如果未指定目标,则影响命令执行者。 |
/health
| 子命令 |
语法 |
描述 |
start |
/health start <target> <health> [slotList] |
将目标的生命值锁定为给定值(1–100)。如果省略 slotList,则锁定为无条件。 |
stop |
/health stop [target] |
解除锁定并将最大生命值恢复为 20。 |
/pvp
| 子命令 |
语法 |
描述 |
start |
/pvp start <targets> |
禁用目标的 PvP 功能(他们无法伤害其他玩家)。 |
stop |
/pvp stop [targets] |
重新启用 PvP。 |
/autosp
| 子命令 |
语法 |
描述 |
start |
/autosp start <targets> |
启用自动重生点——死亡后,玩家的重生点将被设置为死亡位置。 |
stop |
/autosp stop [targets] |
禁用该功能。 |
? SlotList 格式(适用于 /choke 和 /health)
slotList 是一个可选的 JSON 数组,用于定义特定物品栏槽位的条件。
每个条目都是一个对象,以槽位名称为键,值为包含物品 ID 和所需数量的对象。
槽位名称:
hotbar.0 至 hotbar.8 – 快捷栏
inventory.9 至 inventory.35 – 背包
armor.head, armor.chest, armor.legs, armor.feet – 护甲
offhand – 副手
物品格式: "namespace:item"(例如 "minecraft:diamond")。
数量是可选的;如果省略,则接受任意数量。一个槽位中的多个物品充当OR逻辑(满足其中任意一个即可)。
示例:
[
{"hotbar.8": {"minecraft:bedrock": 1}},
{"armor.head": {"create:diving_helmet": 1, "create:netherite_diving_helmet": 1}},
{"inventory.32": {"minecraft:netherite_block": 32}}
]
这要求:
- 第 8 个槽位(快捷栏最后一个)至少有 1 个基岩。
- 头盔槽位拥有要么潜水头盔要么下界合金潜水头盔。
- 背包第 32 号槽位恰好有 32 个下界合金块。
? 权限
所有命令都需要 OP 等级 2(大多数服务器管理员的默认等级)。
在单人游戏中,请启用作弊或在服务器环境中使用 /op 命令。
? 许可证
除非源代码中另有说明,否则本模组在保留所有权利下分发。
你可以在自己的服务器上使用该模组,但重新分发或修改需要获得作者的明确许可。
? 致谢
? 联系方式
作者:DogOfFurina
问题与建议:GitHub Issues
Player Utils
A powerful administrative mod for NeoForge 1.21.1 that adds four essential commands for gameplay control.
✨ Features
- /choke – Force players to suffocate unless specific inventory conditions are met.
Oxygen depletes rapidly and causes damage when empty. Conditions are optional.
- /health – Lock a player's health to a fixed value (1–100) until conditions are met.
Supports optional inventory conditions.
- /pvp – Disable a player's ability to attack other players.
Simple on/off toggle.
- /autosp – Automatically sets your spawnpoint to your death location when you die.
Click the respawn button to respawn exactly where you died.
All states are persisted in each player's NBT data, surviving server restarts and relogs.
? Command Reference
/choke
| Subcommand |
Syntax |
Description |
start |
/choke start <targets> [slotList] |
Starts suffocating the target players. If slotList is omitted, the effect is unconditional (always active). |
stop |
/choke stop [targets] |
Stops the effect. If no targets are given, affects the command sender. |
/health
| Subcommand |
Syntax |
Description |
start |
/health start <target> <health> [slotList] |
Locks the target's health to the given value (1–100). If slotList is omitted, the lock is unconditional. |
stop |
/health stop [target] |
Releases the lock and restores max health to 20. |
/pvp
| Subcommand |
Syntax |
Description |
start |
/pvp start <targets> |
Disables PvP for the targets (they cannot damage other players). |
stop |
/pvp stop [targets] |
Re-enables PvP. |
/autosp
| Subcommand |
Syntax |
Description |
start |
/autosp start <targets> |
Enables auto spawnpoint – upon death, the player's spawnpoint is set to the death location. |
stop |
/autosp stop [targets] |
Disables the feature. |
? SlotList Format (for /choke and /health)
The slotList is an optional JSON array that defines conditions on specific inventory slots.
Each entry is an object with the slot name as key and an object of item IDs and required counts.
Slot names:
hotbar.0 to hotbar.8 –hotbar
inventory.9 to inventory.35 –inventory
armor.head, armor.chest, armor.legs, armor.feet –armor
offhand –offhand
Item format: "namespace:item" (e.g., "minecraft:diamond").
Count is optional; if omitted, any amount is accepted. Multiple items in one slot act as OR (any of them works).
Example:
[
{"hotbar.8": {"minecraft:bedrock": 1}},
{"armor.head": {"create:diving_helmet": 1, "create:netherite_diving_helmet": 1}},
{"inventory.32": {"minecraft:netherite_block": 32}}
]
This requires:
- Slot 8 (last hotbar slot) has at least 1 bedrock.
- Helmet slot has either a diving helmet or a netherite diving helmet.
- Inventory slot 32 has exactly 32 netherite blocks.
? Permissions
All commands require OP level 2 (default for most server admins).
In singleplayer, enable cheats or use /op in a server environment.
? License
This mod is distributed under All Rights Reserved unless otherwise stated in the source code.
You may use it on your server, but redistribution or modification requires explicit permission from the author.
? Acknowledgements
- NeoForge for the modding framework.
- All contributors and testers.
? Contact
Author: DogOfFurina
Issues & suggestions: GitHub Issues
评论 0
登录后参与评分
还没有评论,来抢沙发吧