Data Command

Data Command 是一个轻量级的开发者实用工具,允许数据包创建具有用户输入支持的全自定义命令。通过 JSON 定义命令,在函数中接收参数,并构建仅靠原版数据包无法实现的系统。
✨ 为什么选择 Data Command?
Minecraft 数据包在处理玩家输入方面一直存在局限。虽然 /trigger 只能接受整数,但许多系统需要实际的文本输入。
Data Command 通过允许数据包定义自己的命令并在函数中直接接收解析后的参数来解决这一问题。
示例包括:
- 身份验证系统
- 城镇和阵营名称
- 经济命令
- RPG 职业
- 对话系统
- 服务器工具
- 自定义管理工具
? 功能特性
- 完全通过 JSON 定义的自定义命令。
- 字符串参数。
- 整数参数。
- 布尔参数。
- 自动参数解析。
- 与数据包友好的集成方式。
- 轻量级且专注于依赖的设计。
- 专为数据包开发者设计。
? 示例
文件夹结构:
/data/example/command/town.json
/data/example/function/create_town.mcfunction
命令定义:
{
"function": "example:create_town",
"permission_level": 0,
"args": [
{
"name": "name",
"type": "String",
"required": true
},
{
"name": "max_members",
"type": "Integer",
"required": false,
"default": 20
},
{
"name": "public",
"type": "Boolean",
"required": false,
"default": true
}
]
}
当玩家执行:
/town TinyVille 50 true
Data Command 将运行:
example:create_town
并附带以下宏变量:
{
"name": "TinyVille",
"max_members": 50,
"public": true
}
⚠️ Beta 状态
这是 Data Command 的第一个测试版发布。
已知问题
- 无效的参数错误提示可能不够清晰。
- 重新加载数据包时可能需要偶尔重新连接。
请报告您遇到的任何错误。
❓ 常见问题
这是一个数据包吗?
不。Data Command 是一个模组/库,旨在供数据包使用。
玩家需要安装它吗?
除非数据包特别需要客户端功能,否则只有服务器需要安装 Data Command。
我可以在自己的数据包中使用它吗?
可以。Data Command 被设计为作为其他项目的依赖项使用。
API 稳定吗?
尚未稳定。由于这是早期测试版,部分 API 可能会发生变化。
? 反馈
发现了错误或有什么功能建议?
- 在 GitHub 上报告问题。
- 分享反馈和建议。
- 帮助改进 Data Command 的未来版本。
Data Command

Data Command is a lightweight developer utility that allows datapacks to create fully custom commands with support for user input. Define commands in JSON, receive arguments inside functions, and build systems that would normally be impossible using vanilla datapacks alone.
✨ Why Data Command?
Minecraft datapacks have always been limited when it comes to player input. While /trigger can only accept integers, many systems require actual text input.
Data Command solves this by allowing datapacks to define their own commands and receive parsed arguments directly inside functions.
Examples include:
- Authentication systems
- Town and faction names
- Economy commands
- RPG classes
- Dialogue systems
- Server utilities
- Custom admin tools
? Features
- Custom commands defined entirely through JSON.
- String arguments.
- Integer arguments.
- Boolean arguments.
- Automatic argument parsing.
- Datapack-friendly integration.
- Lightweight and dependency-focused design.
- Designed specifically for datapack developers.
? Example
Folder structure:
/data/example/command/town.json
/data/example/function/create_town.mcfunction
Command definition:
{
"function": "example:create_town",
"permission_level": 0,
"args": [
{
"name": "name",
"type": "String",
"required": true
},
{
"name": "max_members",
"type": "Integer",
"required": false,
"default": 20
},
{
"name": "public",
"type": "Boolean",
"required": false,
"default": true
}
]
}
When a player executes:
/town TinyVille 50 true
Data Command runs:
example:create_town
with the following macros:
{
"name": "TinyVille",
"max_members": 50,
"public": true
}
⚠️ Beta Status
This is the first beta release of Data Command.
Known Issues
- Invalid argument errors may be unclear.
- Reloading datapacks may occasionally require reconnecting.
Please report any bugs you encounter.
❓ FAQ
Is this a datapack?
No. Data Command is a mod/library intended to be used by datapacks.
Do players need to install it?
Only the server needs Data Command unless a datapack specifically requires client-side functionality.
Can I use it in my own datapack?
Yes. Data Command is designed to be used as a dependency for other projects.
Is the API stable?
Not yet. As this is an early beta release, some APIs may change.
? Feedback
Found a bug or have a feature request?
- Report issues on GitHub.
- Share feedback and suggestions.
- Help improve future releases of Data Command.
评论 0
登录后参与评分
还没有评论,来抢沙发吧