Vanilla Permissions
此模组将权限检查功能加入原版游戏,以实现完整的权限自定义。
权限
| 权限 |
描述 |
minecraft.adminbroadcast.receive |
接收命令反馈 |
minecraft.bypass.spawn-protection |
在出生点保护范围内建造 |
minecraft.bypass.force-gamemode |
绕过强制游戏模式 |
minecraft.bypass.move-speed.player |
绕过“玩家移动过快”检测 |
minecraft.bypass.move-speed.vehicle.<entity> |
骑乘 entity(例如 minecraft.boat)时,绕过“玩家移动过快”检测 |
minecraft.bypass.chat-speed |
发送消息或命令过快时,绕过聊天踢出机制 |
minecraft.bypass.whitelist |
绕过服务器白名单 |
minecraft.bypass.player-limit |
绕过服务器玩家人数上限 |
minecraft.command.<command> |
命令权限,更多信息请参阅 commands |
minecraft.debug_stick.use.<block> |
对 block(例如 minecraft.oak_trapdoor)使用调试棒 |
minecraft.debug_chart |
查看调试图表 |
minecraft.<query/load>.<entity/block> |
使用 NBT 数据放置方块并使用调试命令 |
minecraft.operator_block.<command_block/jigsaw/structure_block>.<place/view/edit/break> |
放置、查看、编辑和破坏指令方块、结构方块与拼图方块。 |
minecraft.selector |
在命令中使用实体选择器 |
minecraft.selector.entity.<selector> |
允许使用 selector 选择 非玩家实体 |
minecraft.selector.player.<selector> |
允许使用 selector 选择 其他玩家 |
minecraft.selector.self.<selector> |
允许使用 selector 选择 自身 |
元数据
有时也被称为“选项”或“变量”。
不正确的类型被视为未定义值。
命令
此模组使用 Brigadier 的基于节点的权限系统。每个命令由多个节点组成,每个节点都有其各自的权限。
例如,/gamemode 命令:
- 根命令节点(
/gamemode)需要 minecraft.command.gamemode 权限。
- 子节点如
survival、creative 等,分别使用 minecraft.command.gamemode.survival、
minecraft.command.gamemode.creative 等权限。
在原版 Minecraft 中,只有根节点有权限检查(例如 OP 等级 2)。一旦玩家拥有该根节点的访问权限,所有子节点默认均视为已解锁。
如果您希望更精细地控制,可以通过拒绝特定权限来手动限制子节点。
示例
Allow:
minecraft.command.gamemode
Deny:
minecraft.command.gamemode.creative
minecraft.command.gamemode.spectator
这允许玩家使用 /gamemode 命令,但将其限制为仅允许的选项
(例如生存模式和冒险模式)。
其他命令请参阅各命令在 Minecraft Wiki 页面上的 语法 部分。
选择器
命令方块和数据包会绕过所有选择器权限检查。
默认情况下,授予 minecraft.selector 权限允许玩家在他们有权限使用的命令中使用任何选择器。
细粒度权限控制按以下方式运作。请注意,此模组基于选择结果进行限制,而非原始的选择器语法。如果产生相同的结果,使用玩家名称、UUID 或类似 @e 的选择器等价。
<selector> 的值
<selector> 字符串遵循以下格式:<command_name>.<selector_name>.<subsequent_arguments>,其中:
<command_name> 是根命令名称
<selector_name> 匹配 Minecraft Wiki 命令 Arguments 部分中的参数名称
<subsequent_arguments> 追踪选择器之后的命令参数层级结构
例如,在 /teleport 命令中:
<targets> 和 <destination> 是有效的选择器名称
(它们是 entity 选择器)
- 后续参数构成路径的剩余部分
大多数选择器是 entity 选择器,目前受支持。
完整的支持列表请参阅 下方。
示例
| Command |
Syntax (See Minecraft Wiki) |
Selector to Control |
<selector> Construction |
/teleport @e @s |
teleport <targets> <destination> |
@e |
teleport.targets.targets.destination |
/teleport @e @s |
teleport <targets> <destination> |
@s |
teleport.destination.targets.destination |
/teleport @e ~ ~ ~ |
teleport <targets> <location> |
@e |
teleport.targets.targets.location |
通配符支持
选择器权限可能很长。幸运的是,你可以使用通配符,例如 teleport.* 来覆盖所有传送命令
选择器。
然而,Luckperms 不支持元数据的通配符。你可以安装
[this mod](
'Metadata Wildcard for fabric-permissions-api') 以启用它。
范围控制
使用这些权限来定义选择器范围:
minecraft.selector.entity.<selector>
minecraft.selector.player.<selector>
minecraft.selector.self.<selector>
如果玩家尝试选择未经授权实体,命令将失败。默认情况下允许所有三个范围(即 minecraft.selector.*)。
简单示例
Allow:
minecraft.command.waypoint
minecraft.selector
Deny:
minecraft.selector.player.waypoint.*
minecraft.selector.entity.waypoint.*
玩家仅能修改自己的路标。
复杂示例
Allow:
minecraft.command.teleport # /teleport
minecraft.selector # 所有选择器
minecraft.selector.player.teleport.destination.destination #1
minecraft.selector.entity.teleport.destination.destination #2
minecraft.selector.entity.teleport.targets.targets.destination #3
minecraft.selector.player.teleport.facingEntity.* #4
Deny:
minecraft.selector.player.teleport.* #6
minecraft.selector.entity.* #5
minecraft.selector.self.teleport.facingEntity.* #7
命令行为:
| 命令 |
自身 |
非自身玩家 |
非玩家实体 |
结果行为 |
/teleport <destination> |
<destination> 默认允许 |
<destination> 由 #? 允许 |
<destination> 由 #? 允许 |
传送至任意实体 |
/teleport <targets> <destination> |
<targets> 默认允许
<destination> 默认允许 |
<targets> 由 #? 拒绝
<destination> 由 #? 拒绝 |
<targets> 由 #? 允许
<destination> 由 #? 拒绝 |
仅将非玩家实体传送至自身 |
/teleport <location> |
(无选择器) |
- |
- |
不受限制的位置传送 |
/teleport <targets> <location> |
<targets> 默认允许 |
<targets> 由 #? 拒绝 |
<targets> 由 #? 拒绝 |
仅将自身传送至位置 |
/teleport <targets> <location> facing entity <facingEntity> |
<targets> 默认允许
<facingEntity> 由 #? 拒绝 |
<targets> 由 #? 拒绝
<facingEntity> 由 #? 允许 |
<targets> 由 #? 拒绝
<facingEntity> 由 #? 拒绝 |
面向非自身玩家时,将自身传送至位置 |
实体数量限制
设置元数据 minecraft.selector.limit.<selector> 以限制通过给定选择器可选择的实体最大数量。
如果未设置此元数据,则不应用任何限制。
选择权重
由元数据 minecraft.selector.weight.<selector> 控制。
没有权重设置的实体始终可以选择任何目标并被任何选择器选中。当两个实体都拥有
权重值:选择器只能选择权重大于等于其自身的目标。
示例
你需要先安装 [这个模组](
'Metadata Wildcard for fabric-permissions-api')。
# 全局权限
Allow:
minecraft.command.gamemode
minecraft.selector
# 玩家特定的元数据
Player1: minecraft.selector.weight.gamemode.* = 7
Player2: minecraft.selector.weight.gamemode.* = -1
Player3: minecraft.selector.weight.gamemode.* = 7
Player4: (未设置权重)
| 玩家 |
可修改的游戏模式对象 |
原因 |
| Player1 |
所有玩家 |
权重 ($7$) ≥ 其他所有人的权重 |
| Player2 |
仅限 Player2 和 Player4 |
权重 ($-1$) Player1/Player3 ($7$) 对 Player4 无权重限制 |
| Player3 |
所有玩家 |
权重 ($7$) ≥ 其他所有人的权重 |
| Player4 |
所有玩家 |
无权重限制 → 访问不受限 |
状态
以下列表展示了哪些选择器支持细粒度权限:
生活质量改进
服务端
如果该模组安装在服务端,它会让客户端认为自己是 OP(管理员)。这使得拥有相应权限的玩家能够放置需要管理员权限的方块并访问游戏模式切换菜单。
执行命令
- 包含另一个条件:
/execute if permission <entity> <permission>,允许数据包检查权限(例如 /execute if permission @s group.admin run say I am an admin)
- #### 修饰符
feedback 修饰符 /execute feedback [silent | console] 或 /execute feedback entity <entity> 用于静音或重定向命令反馈(例如 /execute feedback silent run gamemode creative)
oplevel 修饰符 /execute oplevel <level> 或 /execute oplevel <targets> 可用于降低命令源上下文的 OP 权限级别。如果你希望以用户身份运行命令(从函数或控制台),但希望绕过权限检查生效时,这会很有用(例如 /execute as DrexHD oplevel entity @s run rtp,这将使用玩家 DrexHD 的 OP 级别,而不是实际命令执行者来检查如 rtp.bypass 之类的权限)
客户端
如果该模组安装在客户端,只要玩家有权限使用该命令但不是 OP(这对基于 Spigot 的服务器很有用!),也可以访问游戏模式切换菜单。
Vanilla Permissions
This mod adds permission checks into vanilla, to allow for full permission customization.
Permissions
| Permission |
Description |
minecraft.adminbroadcast.receive |
Receive command feedback |
minecraft.bypass.spawn-protection |
Build inside spawn protection |
minecraft.bypass.force-gamemode |
Bypass forced gamemode |
minecraft.bypass.move-speed.player |
Bypass "Player moved too fast" |
minecraft.bypass.move-speed.vehicle.<entity> |
Bypass "Player moved too fast", while riding an entity (e.g minecraft.boat) |
minecraft.bypass.chat-speed |
Bypass chat kick, when sending messages / commands to quick |
minecraft.bypass.whitelist |
Bypass server whitelist |
minecraft.bypass.player-limit |
Bypass server player limit |
minecraft.command.<command> |
Command permissions, see commands for more information |
minecraft.debug_stick.use.<block> |
Use debug stick on block (e.g. minecraft.oak_trapdoor) |
minecraft.debug_chart |
View debug chart |
minecraft.<query/load>.<entity/block> |
Place blocks with nbt data and use debug commands |
minecraft.operator_block.<command_block/jigsaw/structure_block>.<place/view/edit/break> |
Place, view, edit and break operator blocks. |
minecraft.selector |
Use entity selectors in commands |
minecraft.selector.entity.<selector> |
Allow selecting non-player entities using the selector |
minecraft.selector.player.<selector> |
Allow selecting nonself players using the selector |
minecraft.selector.self.<selector> |
Allow selecting self using the selector |
Meta
Also sometimes referred to as "options" or "variables".
Incorrect types are considered undefined values.
Commands
This mod uses Brigadier's node-based permission system. Each command is made up
of multiple nodes, and each node has its own permission.
For example, the /gamemode command:
- The root command node (
/gamemode) requires minecraft.command.gamemode.
- Sub-nodes like
survival, creative, etc., use minecraft.command.gamemode.survival,
minecraft.command.gamemode.creative, and so on.
In vanilla Minecraft, only the root node has a permission check (e.g. OP level 2). Once a player has access to that
root node, all sub-nodes are considered unlocked by default.
If you want finer control, you can manually restrict sub-nodes by denying their specific permissions.
Example
Allow:
minecraft.command.gamemode
Deny:
minecraft.command.gamemode.creative
minecraft.command.gamemode.spectator
This allows players to use /gamemode but restricts them to only the allowed sub-options
(e.g., survival and adventure).
For other commands, see Syntax section of each command's Minecraft Wiki page.
Selectors
Command blocks and datapacks bypass all selector permission checks.
By default, granting minecraft.selector allows players to use any selector in commands they have access to.
Fine-grained permission control operates as follows. Note that this mod restricts based on selection results, not
raw selector syntax. Using player names, UUIDs, or selectors like @e are equivalent if they produce identical
results.
Value of <selector>
The <selector> string follows the format: <command_name>.<selector_name>.<subsequent_arguments> where:
<command_name> is the root command name
<selector_name> matches the argument name in the command's Arguments section on Minecraft Wiki
<subsequent_arguments> traces the command's argument hierarchy after the selector
For example, in the /teleport command:
<targets> and <destination> are valid selector names
(they are entity selectors)
- Subsequent arguments form the remainder of the path
Most selectors are entity selectors, which is supported.
For a complete support list, see below.
Example
| Command |
Syntax (See Minecraft Wiki) |
Selector to Control |
<selector> Construction |
/teleport @e @s |
teleport <targets> <destination> |
@e |
teleport.targets.targets.destination |
/teleport @e @s |
teleport <targets> <destination> |
@s |
teleport.destination.targets.destination |
/teleport @e ~ ~ ~ |
teleport <targets> <location> |
@e |
teleport.targets.targets.location |
Wildcard Support
Selector permissions can be lengthy. Luckily you can use wildcards, like teleport.* to cover all teleport command
selectors.
However, Luckperms doesn't support wildcard for metadata. You could install
[this mod](
'Metadata Wildcard for fabric-permissions-api') to enable it.
Scope Control
Use these permissions to define selector scope:
minecraft.selector.entity.<selector>
minecraft.selector.player.<selector>
minecraft.selector.self.<selector>
Commands fail if a player attempts to select unauthorized entities. All three scopes (that is, minecraft.selector.*)
are allowed by default.
Simple Example
Allow:
minecraft.command.waypoint
minecraft.selector
Deny:
minecraft.selector.player.waypoint.*
minecraft.selector.entity.waypoint.*
Players modify only their own waypoints.
Complex Example
Allow:
minecraft.command.teleport # /teleport
minecraft.selector # All selectors
minecraft.selector.player.teleport.destination.destination #1
minecraft.selector.entity.teleport.destination.destination #2
minecraft.selector.entity.teleport.targets.targets.destination #3
minecraft.selector.player.teleport.facingEntity.* #4
Deny:
minecraft.selector.player.teleport.* #6
minecraft.selector.entity.* #5
minecraft.selector.self.teleport.facingEntity.* #7
Command Behavior:
| Command |
Self |
Nonself Players |
Non-player Entities |
Resulting Behavior |
/teleport <destination> |
<destination> allowed by default |
<destination> allowed by #? |
<destination> allowed by #? |
Teleport to any entity |
/teleport <targets> <destination> |
<targets> allowed by default
<destination> allowed by default |
<targets> denied by #?
<destination> denied by #? |
<targets> allowed by #?
<destination> denied by #? |
Only teleport non-player entities to self |
/teleport <location> |
(No selectors) |
- |
- |
Unrestricted position teleport |
/teleport <targets> <location> |
<targets> allowed by default |
<targets> denied by #? |
<targets> denied by #? |
Only teleport self to positions |
/teleport <targets> <location> facing entity <facingEntity> |
<targets> allowed by default
<facingEntity> denied by #? |
<targets> denied by #?
<facingEntity> allowed by #? |
<targets> denied by #?
<facingEntity> denied by #? |
Teleport self to positions while facing nonself players |
Entity Limit
Set meta minecraft.selector.limit.<selector> to restrict the maximum number of entities selectable via a
given selector.
No limit is applied if this meta is unset.
Selection Weight
Controlled by meta minecraft.selector.weight.<selector>.
Entities without weight settings can always select any target and be selected by any selector. When both entities have
weight values, a selector can only select targets whose weight is less than or equal to its own.
Example
You need to install [this mod](
'Metadata Wildcard for fabric-permissions-api') first.
# Global permissions
Allow:
minecraft.command.gamemode
minecraft.selector
# Player-specific metadata
Player1: minecraft.selector.weight.gamemode.* = 7
Player2: minecraft.selector.weight.gamemode.* = -1
Player3: minecraft.selector.weight.gamemode.* = 7
Player4: (no weight set)
| Player |
Can modify gamemode of |
Reason |
| Player1 |
All players |
Weight ($7$) ≥ all others' weights |
| Player2 |
Only Player2 and Player4 |
Weight ($-1$) Player1/Player3 ($7$) No weight restriction for Player4 |
| Player3 |
All players |
Weight ($7$) ≥ all others' weights |
| Player4 |
All players |
No weight restriction → unrestricted access |
Status
The following list shows which selectors can use fine-grained permissions:
Quality of Life
Server Side
If the mod is installed server-side, it will make clients think they're OP. This allows players with appropriate
permissions to place operator blocks and access the gamemode switcher menu.
Execute Command
- Includes another condition:
/execute if permission <entity> <permission> to allow datapacks to
check permissions (e.g. /execute if permission @s group.admin run say I am an admin)
- #### Modifiers
- The
feedback modifier /execute feedback [silent | console] or /execute feedback entity <entity> is used to
silence, or redirect command feedback (e.g. /execute feedback silent run gamemode creative)
- The
oplevel modifier /execute oplevel <level> or /execute oplevel <targets> can be used to reduce the op
permission level of the command source context, this can be useful if you want to run a command as a user (from
functions or console), but want bypass permissions to work (e.g. /execute as DrexHD oplevel entity @s run rtp,
this will use the op level of the player DrexHD instead of the actual command executor for checking permissions
like rtp.bypass)
Client Side
If the mod is installed on the client, the gamemode switcher can also be accessed, if the player has access to the
command, but isn't OP (useful for spigot-based servers)!
评论 0
登录后参与评分
还没有评论,来抢沙发吧