Skip to content

Reference

kltyton edited this page Oct 20, 2026 · 2 revisions

Translation Key Reference / 语言键参考

中文指南 · English Guide

Language files use assets/command_translation/lang/<locale>.json, or the same keys in a mod's own language namespace. Paths below use original command-node names and raw IDs.

语言文件放在 assets/command_translation/lang/<locale>.json,或把相同的键加入模组自己的语言命名空间。下表中的路径和 ID 都使用原始写法。

Names and Aliases / 名称与别名

Key Purpose / 用途
command_translation.namespace.<modid> Namespace display name / 命名空间译名
command_translation.command.<root>.namespace Owner modid for an unqualified root / 裸根命令的所属 modid
command_translation.command.<root>.alias Root aliases, separated by | / 根命令别名
command_translation.literal.<full path>.alias Literal subcommand aliases / 字面子命令别名
command_translation.literal.<literal>.alias Shared literal fallback / 共用字面项回退
command_translation.value.<original value>.alias Finite argument aliases / 有限枚举值别名
command_translation.registry.<registry ID>.<resource ID>.name Explicit resource name / 资源名称覆盖
command_translation.name.<family>.field.<path> Context-specific short field name / 上下文字段短名称
command_translation.name.field.<raw field name> Explicit shared short field name / 显式共用字段短名称
command_translation.name.<family>.field.<path>.value.<raw value> Short value name / 具体值短名称
command_translation.name.value.type.<type name>.<raw value> Shared short value name / 共用值短名称
command_translation.tag.<registry path>.<namespace>.<tag path> Registry-specific tag name / 分注册表的标签名称

The minecraft: prefix is removed from vanilla root documentation paths. Other namespaces stay intact. Tag-key registry/resource paths replace slashes with dots; full IDs in general registry keys keep colons and slashes.

原版根命令的 minecraft: 前缀在说明路径中去掉,其他命名空间保留。只有标签键把注册表和资源路径中的斜线换成点;通用注册表键保留完整冒号和斜线。

Commands and Syntax / 命令与语法

Key Purpose / 用途
command_translation.help.command.<root> Command purpose / 命令作用
command_translation.help.argument.<full node path> Specific argument / 具体参数
command_translation.help.argument.<root>.<argument> Shared argument fallback / 共用参数回退
command_translation.help.value.<full node path>.<raw value> Context-specific value / 上下文中的具体值
command_translation.help.value.<root>.<argument>.<raw value> Shared value fallback / 共用值回退
command_translation.help.value.type.<native parser ID>.<raw value> Native argument-type value help / 原生参数类型值说明
command_translation.help.argument.<full node path>.registry Documentation registry binding / 说明查询的注册表绑定
command_translation.syntax.argument.<full node path> Specific small syntax annotation / 具体小字标注
command_translation.syntax.argument.<argument> Shared small annotation / 共用小字标注

A Boolean argument should use a context-specific value key rather than the generic native-parser key. Required/optional markers, branches and redirects come from the live command tree.

布尔参数使用具体上下文的值说明键,不使用通用的原生参数类型值键。必填、可选、分支和重定向标记由实际命令树提供。

Structured Data / 结构化数据

Prefix every key in this table with command_translation.help..

下表所有键都以 command_translation.help. 开头。

Suffix Purpose / 用途
component.<component ID> Component meaning / 组件用途
<family>.field.<path> Field meaning / 字段用途
<family>.field.<path>.value.<raw value> Exact value / 具体值
<family>.field.<path>.registry Value registry / 值的注册表
<family>.field.<path>.key_registry Registry of dictionary keys / 字典键的注册表
<family>.field.<path>.value_type Shared value type / 共用值类型
value.type.<type name>.<raw value> Shared type value / 共用类型中的具体值
component.<component ID>.registry Direct component value registry / 组件直接值的注册表
component.<component ID>.value_type Direct component shared value type / 组件直接值的共用类型
component.<component ID>.value.<raw value> Exact direct component value / 组件直接值说明
registry.<registry ID>.<resource ID> Reusable registry-value description / 可复用的注册表值说明

Families / 字段族: component.<ID>, nbt.item, nbt.entity, nbt.entity.<entity ID>, nbt.block_entity, selector, block_state, block_state.<block ID>, text, dialog, particle.<particle ID>.

An entity-specific NBT family applies when the command context supplies its entity type. Arrays omit their numeric indices. Wildcards match path members; exact value entries take priority over shared value types.

实体专用 NBT 字段族在命令上下文能确定实体类型时使用。数组不包含数字下标,通配符匹配路径成员,具体值词条优先于共用值类型。

Names are short labels used for display and insertion. Descriptions are tooltip/search text, never executable aliases. Missing names retain raw keys or values. The independent name. prefix avoids collisions with nested fields called name. Component names use the general registry-name key for minecraft:data_component_type; component descriptions keep help.component.<ID>.

名称用于显示和插入,描述用于悬停和搜索,不能作为执行别名。缺少名称时保留原始键值。独立的 name. 前缀不会与名为 name 的嵌套字段混用。组件名称使用 minecraft:data_component_type 的通用注册表名称键,组件描述继续使用 help.component.<ID>。

flowchart TD
    V["Exact field value / 具体字段值"] --> T["Shared value type / 共用值类型"]
    T --> R["Bound registry / 绑定的注册表"]
    R --> N["Existing name or field context / 既有名称或字段上下文"]
Loading

Source Reference / 源码参考

Detailed tooltip resource contract

The implementation reads these keys through CommandLanguage, NamespaceNames, CommandDocumentation, DocumentationKeys and ValueDocumentation. These class names locate the implementation; language resources are the extension interface, not an instruction to call internal classes.

上述类名用于定位实现;扩展入口是语言资源,不需要直接调用内部 Java 类。