SiliconGhetto Engine API
    Preparing search index...

    Function createWorldAPI

    • Returns {
          getBlock(x: number, y: number, z: number): number;
          setBlock(x: number, y: number, z: number, type: number): void;
          setBlockMeta(
              x: number,
              y: number,
              z: number,
              type: number,
              meta: number,
          ): void;
          getBlockMeta(x: number, y: number, z: number): number;
          getLightLevel(x: number, y: number, z: number): number;
          getBiome(x: number, z: number): string;
          isPassable(blockType: number): boolean;
          isTransparent(blockType: number): boolean;
          getLightEmission(blockType: number): number;
          fill(
              x1: number,
              y1: number,
              z1: number,
              x2: number,
              y2: number,
              z2: number,
              blockType: number,
          ): void;
          getRenderDistance(): number;
          setRenderDistance(rd: number): void;
          getWorldHeight(): number;
      }

      • getBlock: function
        • Get the block type at a world position.

          Parameters

          • x: number

            World X coordinate

          • y: number

            World Y coordinate

          • z: number

            World Z coordinate

          Returns number

          Block type ID (0 = air)

      • setBlock: function
        • Place or replace a block at a world position.

          Parameters

          • x: number

            World X coordinate

          • y: number

            World Y coordinate

          • z: number

            World Z coordinate

          • type: number

            Block type ID to place (0 = air, effectively removes the block)

          Returns void

      • setBlockMeta: function
        • Set a block and its metadata at a world position.

          Parameters

          • x: number

            World X coordinate

          • y: number

            World Y coordinate

          • z: number

            World Z coordinate

          • type: number

            Block type ID

          • meta: number

            Metadata value (block-specific, e.g. crop growth stage)

          Returns void

      • getBlockMeta: function
        • Get the metadata value for the block at a world position.

          Parameters

          • x: number

            World X coordinate

          • y: number

            World Y coordinate

          • z: number

            World Z coordinate

          Returns number

          Metadata value

      • getLightLevel: function
        • Get the light level at a world position (0 = pitch black, 15 = full sunlight).

          Parameters

          • x: number

            World X coordinate

          • y: number

            World Y coordinate

          • z: number

            World Z coordinate

          Returns number

          Light level (0-15)

      • getBiome: function
        • Get the biome name at a horizontal position.

          Parameters

          • x: number

            World X coordinate

          • z: number

            World Z coordinate

          Returns string

          Biome name string

      • isPassable: function
        • Check whether a block type is passable (entities can walk through it).

          Parameters

          • blockType: number

            Block type ID

          Returns boolean

          True if the block is passable

      • isTransparent: function
        • Check whether a block type is transparent (light passes through it).

          Parameters

          • blockType: number

            Block type ID

          Returns boolean

          True if the block is transparent

      • getLightEmission: function
        • Get the light emission value of a block type.

          Parameters

          • blockType: number

            Block type ID

          Returns number

          Light emission level (0 = none, higher = brighter)

      • fill: function
        • Fill a rectangular region with a single block type.

          Parameters

          • x1: number

            Start X coordinate

          • y1: number

            Start Y coordinate

          • z1: number

            Start Z coordinate

          • x2: number

            End X coordinate (inclusive)

          • y2: number

            End Y coordinate (inclusive)

          • z2: number

            End Z coordinate (inclusive)

          • blockType: number

            Block type ID to fill with

          Returns void

      • getRenderDistance: function
        • Get the current render distance in chunks.

          Returns number

          Render distance

      • setRenderDistance: function
        • Set the render distance in chunks (4-12 recommended).

          Parameters

          • rd: number

            Render distance in chunks

          Returns void

      • getWorldHeight: function
        • Get the world height in blocks.

          Returns number

          World height