神岛 API 文档 - ArenaPro版
    Preparing search index...

    GameVoxels 提供了游戏中所有方块的接口。您可以使用它来控制地形。

    Index

    Advanced

    getVoxelId: (x: number, y: number, z: number) => voxelId

    Type declaration

      • (x: number, y: number, z: number): voxelId
      • Parameters

        • x: number
        • y: number
        • z: number

        Returns voxelId

    检索指定坐标处方块的数字 ID。这是 getVoxel 的一个更高效的版本。

    Retrieves the numeric ID of the voxel at the specified coordinates. This is a more performant version of getVoxel.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    指定坐标处的方块 ID。

    The voxel ID at the specified coordinates.

    setVoxelId: (x: number, y: number, z: number, voxel: voxelId) => voxelId

    Type declaration

    使用方块的数字 ID 在指定坐标处设置一个方块。这是 setVoxel 的一个更高效的版本。

    Sets a voxel at the specified coordinates using its numeric ID. This is a more performant version of setVoxel.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    要设置的方块的 ID。

    The ID of the voxel to set.

    更新后位置的方块 ID。

    The voxel ID of the updated position.

    Grid

    getVoxel: (x: number, y: number, z: number) => voxelId

    Type declaration

      • (x: number, y: number, z: number): voxelId
      • Parameters

        • x: number
        • y: number
        • z: number

        Returns voxelId

    获取指定坐标处的方块 ID。

    Gets the voxel ID at the specified coordinates.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    指定坐标处的方块 ID。

    The voxel ID at the specified coordinates.

    getVoxelRotation: (x: number, y: number, z: number) => voxelRotation

    Type declaration

    获取指定坐标处方块的旋转代码。

    Gets the rotation code of the voxel at the specified coordinates.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    指定坐标处方块的旋转代码。

    The rotation code of the voxel at the specified coordinates.

    setVoxel: (
        x: number,
        y: number,
        z: number,
        voxel: voxelName | voxelId,
        rotation?: voxelRotation,
    ) => voxelId

    Type declaration

    在指定的 x, y, z 坐标处设置一个方块。

    Sets a voxel at the specified x, y, z coordinates.

    x 坐标。

    The x-coordinate.

    y 坐标。

    The y-coordinate.

    z 坐标。

    The z-coordinate.

    要设置的方块的名称或 ID。

    The name or ID of the voxel to set.

    (可选)方块的旋转代码。

    (Optional) The rotation code of the voxel.

    更新后位置的方块 ID。

    The voxel ID of the updated position.

    方块网格在 x、y、z 维度上的大小。

    The size of the voxel grid in the x, y, and z dimensions.

    Voxel

    id: (name: voxelName) => voxelId

    Type declaration

    根据方块的可读名称获取其数字 ID。如果名称无效,则返回 0。

    Gets the numeric ID of a voxel from its human-readable name. Returns 0 if the name is invalid.

    方块的可读名称。

    The human-readable name of the voxel.

    方块的数字 ID,如果名称无效则为 0。

    The numeric ID of the voxel, or 0 if the name is invalid.

    name: (id: voxelId) => "" | voxelName

    Type declaration

    根据方块的数字 ID 获取其可读名称。如果 ID 无效,则返回空字符串。

    Gets the human-readable name of a voxel from its numeric ID. Returns an empty string if the ID is invalid.

    方块的数字 ID。

    The numeric ID of the voxel.

    方块的可读名称,如果 ID 无效则为空字符串。

    The human-readable name of the voxel, or an empty string if the ID is invalid.

    VoxelTypes: string[]

    游戏中所有支持的方块类型的名称数组。

    An array of names for all supported voxel types in the game.