For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/sapi/runtime/functions/dimensionId.md.
  • 简体中文
  • Function: dimensionId()

    function dimensionId(dimension: Dimension): number;

    Defined in: sapi/runtime/tools.ts:248

    将 Minecraft 维度对象转换为紧凑数值代号:

    • 主世界(overworld)→ 0
    • 下界(nether)→ 1
    • 末地(the_end)→ 2

    Parameters

    ParameterTypeDescription
    dimensionDimension目标维度对象。

    Returns

    number

    维度数值代号。