Melius Commands
一个用于 Fabric 的服务端模组,用于创建自定义命令并修改现有命令。
自定义命令
要添加自定义命令,请在 ./config/melius-commands/commands 中创建一个 json 文件。
示例文件请参阅 examples/commands!在游戏中运行 /reload 以应用更改。
JSON 格式
JSON 格式包含注释以供说明(请勿在文件中复制 //)
命令节点(字面量 / 参数)
查看 在线生成器 以快速轻松地创建自定义命令!这还将确保您的语法有效。
根节点必须始终是一个字面量节点。
{
"id": "...",
// 命令 ID(对于字面量命令节点即为命令名称)(必填)
"type": "...",
// 参数类型,见下文。(仅适用于参数节点,必填)
"executes": [
// 命令节点执行列表,见下文。
],
"require": {
// 更多信息请参阅 https://github.com/Patbox/PredicateAPI/。
// 如果它对某个 Command Source 求值为 true,则该源将有权访问此命令节点!
},
"literals": [
// 字面量子节点列表
],
"arguments": [
// 参数字节点列表
],
"redirect": "..."
// 如果指定,该命令将复制指定节点的执行、要求和子节点。
// 这实际上可以为另一个命令创建别名
}
执行
这可以是一个简单的字符串,将以静默方式执行,作为拥有 op 等级 4 的控制台执行,或手动配置如下:
{
"command": "...",
// 将要执行的命令(可以使用 ${id} 引用参数值)
"silent": false,
// 如果设置为 true,则禁用命令输出
"as_console": false,
// 是否将此命令作为控制台命令源执行
"op_level": 4
// 命令源的运算符等级(可选)(可能值:0 - 4)
}
command 执行值可以使用来自命令参数的占位符和全局占位符,使用 ${PLACEHOLDER} 格式,其中 PLACEHOLDER 可以是参数 ID,也可以是全局占位符,例如 player:name。
参数类型
有关所有参数类型的完整列表,请参阅 参数类型维基。 某些参数类型需要额外的参数,这些参数必须以空格分隔附加在后面。
命令修饰符
要添加命令要求,请在 ./config/melius-commands/modifiers 中创建一个 json 文件。
示例文件请参阅 examples/modifiers!
JSON 格式
查看 在线生成器 以快速轻松地创建自定义命令修饰符!这还将确保您的语法有效。
JSON 格式包含注释以供说明(请勿在文件中复制 //)
命令修饰符
语法取决于您选择的修饰符类型。最重要的是要注意有两种类型的命令匹配器:
- 节点匹配器将通过路径匹配命令节点(Brigadier 内部表示命令所使用的结构)(例如
teleport.location将匹配任何此类命令/teleport 0 100 0) - 命令匹配器将针对命令执行期间使用的字符串进行匹配(例如
warp end将匹配/warp end)
这两种类型都有三种不同的变体:
strict修饰符仅应用于完全相同的节点 / 完全相同的命令输入starts_with修饰符将应用于指定的节点 / 命令以及比它“更长”的任何内容regex修饰符将应用于所有匹配正则表达式的内容
节点匹配器有一个名为 requirement_modifier 的额外字段,允许您修改节点的要求,这将使不符合要求的玩家 / 命令源完全无法使用该命令!
命令节点路径
您可以使用 /melius-commands path <cmd> 命令来确定任何命令的命令节点路径。
示例:要检查 /tp DrexHD 0 100 0(将实体传送到方块位置)的路径,请键入
/melius-commands path tp DrexHD 0 100 0,您将收到 teleport.targets.location,您可以在命令修饰符中使用它。
占位符
%melius-commands:cooldown [id]%/%melius-commands:cooldown [id] [formatting]%- 玩家命令冷却时间。[id]是冷却修饰符中指定的 ID。[formatting]是 持续时间格式化, 请确保正确转义。
Melius Commands
A fabric server side mod to create custom, and modify existing commands
Custom Commands
To add custom commands, create a json file in ./config/melius-commands/commands.
For example files, see examples/commands! Apply your changes, by running /reload in-game.
JSON Format
Json format includes comments for clarification (don't copy // in your files)
Command node (literal / argument)
Check out the online generator to create your custom commands quick and easy! This will also make sure your syntax is valid.
The root node must always be a literal node.
{
"id": "...",
// Command id (command name for literal command nodes) (required)
"type": "...",
// Argument type, see below. (argument node only, required)
"executes": [
// A list of command node executions, see below.
],
"require": {
// See https://github.com/Patbox/PredicateAPI/ for further information.
// If this evaluates to true for a Command Source, it will have access to this command node!
},
"literals": [
// A list of literal children nodes
],
"arguments": [
// A list of argument children nodes
],
"redirect": "..."
// If specified the command will copy execution, requirements and children from the specified node.
// This can effectively create an alias for another command
}
Execution
This can either be a simple string, which will be executed silent, as console with op level 4 or manually configured like this:
{
"command": "...",
// The command that will be executed (can reference argument values, with ${id})
"silent": false,
// Disable command output if set to true
"as_console": false,
// Whether this command should be executed as console command source
"op_level": 4
// The operator level of the command source (optional) (Possible values: 0 - 4)
}
The command execution value can use placeholders from command arguments and
global placeholders, by using this format ${PLACEHOLDER}, where PLACEHOLDER
can either be the argument id, or a global placeholder
like player:name.
Argument Type
For a full list of all argument types refer to the Argument types wiki. Some argument types require additional arguments, which must be appended seperated by spaces.
Command Modifiers
To add command requirements, create a json file in ./config/melius-commands/modifiers.
For example files, see examples/modifiers!
JSON Format
Check out the online generator to create your custom command modifiers quick and easy! This will also make sure your syntax is valid.
Json format includes comments for clarification (don't copy // in your files)
Command modifier
The syntax depends on the modifier type you choose. The most important thing to note is that there are two types of command matchers:
- Node matchers will match command nodes (the structure used by brigadier to represent commands internally) by their
path (for example
teleport.location, will match any command like this/teleport 0 100 0) - Command matchers will match against the string used during command execution (for example
warp endwill match/warp end)
Both of these types come with three different flavours:
strictmodifiers will only be applied to that exact node / that exact command inputstarts_withmodifiers will be applied to the specified node / command and anything that is "longer" than itregexmodifiers will be applied to everything matching the regular expression
Node matchers have an extra field called requirement_modifier, which allows you to modify the requirement of the node,
which will completely remove the command from players / command sources that don't meet the requirement!
Command node paths
You can use /melius-commands path <cmd> command to determine command node paths of any command.
Example: to check the path of /tp DrexHD 0 100 0 (teleporting an entity to a block location) you type
/melius-commands path tp DrexHD 0 100 0 and will receive teleport.targets.location, which you can use in command
modifiers.
Placeholders
%melius-commands:cooldown [id]%/%melius-commands:cooldown [id] [formatting]%- Player command cooldowns.[id]is the id specified in the cooldown modifier.[formatting]is the duration formatting, make sure to escape properly.
下载 Melius Commands
下载 Melius Commands
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Melius Commands
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Melius Commands
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复
- 忽略命令中的未知参数
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧