Перейти к основному содержанию

Dimensions

Namespace used to create and manipulate custom dimensions.

Index

Classes

CustomDimension

CustomDimension:

Class representing custom dimension.

constructor

  • Constructs a new dimension with specified name and preferred ID.


    Parameters

    • name: string

      dimension name, can be used to get dimension via Dimensions.getDimensionByName call

    • preferredId: number

      preferred dimension ID. If ID is already occupied by some another dimension, constructor will look for the next empty dimension ID and assign it to the current dimension

    Returns CustomDimension

id

id: number

Custom dimension ID.

hasSkyLight

  • hasSkyLight(): boolean

  • Returns boolean

    Whether the sky produces light in the current dimension.

resetCloudColor

  • Resets clouds color to the default value.


    Returns CustomDimension

    Reference to itself to be used in sequential calls.

resetFogColor

  • Resets fog color to the default value.


    Returns CustomDimension

    Reference to itself to be used in sequential calls.

resetFogDistance

  • Resets fog displaying distance.

    @since

    2.0.2b20


    Returns CustomDimension

    Reference to itself to be used in sequential calls.

resetSkyColor

  • Resets sky color to the default value.


    Returns CustomDimension

    Reference to itself to be used in sequential calls.

resetSunsetColor

  • Resets sunset sky color to the default value.


    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setCloudColor

  • Sets clouds color for the dimension in the RGB format. Default color is as in the Overworld.


    Parameters

    • r: number

      red color component, value from 0 to 1

    • g: number

      green color component, value from 0 to 1

    • b: number

      blue color component, value from 0 to 1

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setFogColor

  • Sets fog color for the dimension in the RGB format. Default color is as in the Overworld.


    Parameters

    • r: number

      red color component, value from 0 to 1

    • g: number

      green color component, value from 0 to 1

    • b: number

      blue color component, value from 0 to 1

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setFogDistance

  • Sets fog displaying distance.

    @since

    2.0.2b20


    Parameters

    • start: number

      nearest fog distance

    • end: number

      farthest fog distance

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setGenerator

  • Sets custom landscape generator.


    Parameters

    • generator: CustomGenerator

      custom landscape generator used for current dimension

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setHasSkyLight

  • Specifies whether the sky produces light (like in overworld) or not (like in the End or Nether).


    Parameters

    • hasSkyLight: boolean

      if true, the sky produces light in the dimension

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setSkyColor

  • Sets sky color for the dimension in the RGB format. Default color is as in the Overworld.


    Parameters

    • r: number

      red color component, value from 0 to 1

    • g: number

      green color component, value from 0 to 1

    • b: number

      blue color component, value from 0 to 1

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

setSunsetColor

  • Sets sunset sky color for the dimension in the RGB format. Default color is as in the Overworld.


    Parameters

    • r: number

      red color component, value from 0 to 1

    • g: number

      green color component, value from 0 to 1

    • b: number

      blue color component, value from 0 to 1

    Returns CustomDimension

    Reference to itself to be used in sequential calls.

CustomGenerator

CustomGenerator:

Class representing landscape generator used for the dimension.

constructor

  • Creates a new Dimensions.CustomGenerator instance using specified base type.


    Parameters

    • baseType: number

      base generator type constant, can be from 0 to 4. 0 and 1 represent overworld generator, 2 represents flat world generator, 3 represents nether generator and 4 represents end generator

    Returns CustomGenerator

removeModGenerationBaseDimension

  • Disables mods generation in current generator.


    Returns CustomGenerator

    Reference to itself to be used in sequential calls.

setBuildVanillaSurfaces

  • Specifies whether to use vanilla biome surface cover blocks (grass, sand, podzol, etc.).


    Parameters

    • value: boolean

      if true, vanilla surface will be generated

    Returns CustomGenerator

    Reference to itself to be used in sequential calls.

setGenerateCaves

  • setGenerateCaves(caves: boolean, underwaterCaves?: boolean): CustomDimension
  • Determines whether the generator should generate underground and/or underwater caves as part of its result. Wworks only with the "overworld"1" and "flat" base types.

    @since

    2.3.1b115


    Parameters

    • caves: boolean

      generate caves

    • optionalunderwaterCaves: boolean

      generate large caves and canyons

    Returns CustomDimension

setGenerateModStructures

  • Specifies whether to use mod's generation callbacks.


    Parameters

    • value: boolean

      if true, mod generation will be used

    Returns CustomGenerator

    Reference to itself to be used in sequential calls.

setGenerateVanillaStructures

  • Specifies whether to generate minecraft vanilla structures.


    Parameters

    • value: boolean

      if true, vanilla structures will be generated

    Returns CustomGenerator

    Reference to itself to be used in sequential calls.

setModGenerationBaseDimension

  • Specifies which of the generation Callbacks to call, -1 to call no mods generation, 0 to call overworld generation callback, 1 for nether, 2 for end generation callbacks.


    Parameters

    • id: number

      generation callback to call

    Returns CustomGenerator

    Reference to itself to be used in sequential calls.

setTerrainGenerator

  • Sets terrain generator object used for the landscape generation.


    Parameters

    • generator: AbstractTerrainGenerator

      terrain generator to be used with current landscape generator or removes terrain generator, if the value is null

    Returns CustomGenerator

    Reference to itself to be used in sequential calls.

MonoBiomeTerrainGenerator

MonoBiomeTerrainGenerator:

Class representing terrain that consists of single biome.

constructor

addTerrainLayer

setBaseBiome

  • Sets base biome for the current terrain.


    Parameters

    • id: number

      ID of the biome to be used as a single biome of the terrain layer

    Returns MonoBiomeTerrainGenerator

NoiseConversion

NoiseConversion:

Class representing noise conversion function. Used to define "density" of the landscape at a given height. Values between nodes are interpolated linearly.

constructor

addNode

  • Adds a new node to the noise conversion function.


    Parameters

    • x: number

      value from 0 to 1 representing the height of the block in the terrain layer

    • y: number

      landscape density at a given height, generally can be between -0.5 and 0.5. Values between nodes are interpolated linearly

    Returns NoiseConversion

NoiseGenerator

NoiseGenerator:

Class representing multi-layer noise generator.

constructor

addLayer

setConversion

NoiseLayer

NoiseLayer:

Class representing single noise layer.

constructor

addOctave

setConversion

NoiseOctave

NoiseOctave:

Class representing noise octave. Each noise layer consists of multiple noise octaves of different scale and weight.

constructor

  • Creates a new noise octave of specified type.


    Parameters

    • optionaltype: number | NoiseOctaveStringType

      numeric type constant or one of the following strings:

      "perlin" (0) is a general-purpose noise generator.

      Used to generate noise of completely random nature "gray" (1) "chess" (2)

      The following sine noises are used to generate sinusoidal noise. Generally they should be used with some noise octaves of other types to avoid too mathematical landscapes "sine_x" (10) "sine_y" (11) "sine_z" (12) "sine_xy" (13) "sine_yz" (14) "sine_xz" (15) "sine_xyz" (16)

    Returns NoiseOctave

setConversion

setScale

  • Parameters

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

    Returns NoiseOctave

setSeed

  • Parameters

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

    Returns NoiseOctave

setTranslate

  • setTranslate(x: number, y: number, z: number): NoiseOctave
  • Parameters

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

    Returns NoiseOctave

setWeight

Interfaces

AbstractTerrainGenerator

AbstractTerrainGenerator:

Interface representing terrain generator. All terrain generators found in Inner Core API implement this interface.

NoiseGeneratorParams

NoiseGeneratorParams:

optionalconversion

layers

NoiseLayerParams

NoiseLayerParams:

optionalconversion

octaves

octaves: NoiseOctaveParams[] | { count?: number; scale?: number; scale_factor?: number; seed?: number; weight?: number; weight_factor?: number }

NoiseOctaveParams

NoiseOctaveParams:

optionalconversion

optionalscale

scale?: Vec3Data

optionalseed

seed?: number

optionaltype

type?: string | number = string | number

Noise octave type, see Dimensions.NoiseOctave for details.

optionalweight

weight?: number

TerrainLayer

TerrainLayer:

Class representing single terrain layer that may consist of several noise layers.

addNewMaterial

getMainMaterial

setHeightmapNoise

setMainNoise

setYConversion

TerrainLayerParams

TerrainLayerParams:

optionalheightmap

optionalmaterial

optionalmaterials

materials?: TerrainMaterialParams[]

maxY

maxY: number

minY

minY: number

optionalnoise

optionalyConversion

yConversion?: NoiseConversionParams

TerrainMaterial

TerrainMaterial:

Class representing material that is used to generate terrain layer.

setBase

setCover

setDiffuse

setFilling

setSurface

TerrainMaterialParams

TerrainMaterialParams:

optionalbase

optionalcover

optionaldiffuse

diffuse?: number

optionalfilling

optionalnoise

optionalsurface

Type Aliases

MaterialBlockData

MaterialBlockData: [number, number?, number?] | { data?: number; id: number; width?: number } | number

NoiseConversionParams

NoiseConversionParams: string | Vec2Data[]

NoiseOctaveStringType

NoiseOctaveStringType: perlin | gray | chess | sine_x | sine_y | sine_z | sine_xy | sine_yz | sine_xz | sine_xyz

Vec2Data

Vec2Data: [number, number] | { x: number; y: number } | number

Vec3Data

Vec3Data: [number, number, number] | { x: number; y: number; z: number } | number

Functions

getAllRegisteredCustomBiomes

  • getAllRegisteredCustomBiomes(): {}
  • @since

    2.2.1b93


    Returns {}

    JS object instance, containing all registered custom biomes.

getDimensionById


  • Parameters

    • id: number

      dimension ID

    Returns CustomDimension

    Custom dimension by it's numeric ID.

getDimensionByName

isLimboId

  • isLimboId(id: number): boolean

  • Parameters

    • id: number

      dimension ID

    Returns boolean

    true, if dimension is a limbo dimension; limbo dimension is created by Horizon automatically if you try to teleport the player to non-existing dimension

newGenerator

  • newGenerator(description: { base?: string | number; biome?: number; buildVanillaSurfaces?: boolean; generateVanillaStructures?: boolean; layers?: TerrainLayerParams[]; modWorldgenDimension?: string | number; type?: string }): CustomGenerator
  • Function used to simplify the creation of terrain generator by passing a json-like structure as a single generator parameter.


    Parameters

    • description: { base?: string | number; biome?: number; buildVanillaSurfaces?: boolean; generateVanillaStructures?: boolean; layers?: TerrainLayerParams[]; modWorldgenDimension?: string | number; type?: string }

      object containing all the required generator information

      • optionalbase: string | number

        Specifies base generator, see CustomGenerator constructor for details.

      • optionalbiome: number

        Sets base biome for the current terrain, applicable only to "mono".

      • optionalbuildVanillaSurfaces: boolean

        Specifies whether to use vanilla biome surface cover blocks (grass, sand, podzol, etc.).

        See setBuildVanillaSurfaces for details.

      • optionalgenerateVanillaStructures: boolean

        Specifies whether to generate minecraft vanilla structures.

        See setGenerateVanillaStructures for details.

      • optionallayers: TerrainLayerParams[]

        An array of terrain layers descriptions, each one representing it's own terrain layer.

        See MonoBiomeTerrainGenerator.addTerrainLayer for details.

      • optionalmodWorldgenDimension: string | number

        Can be either string for an existing dimensions ("overworld", "nether", "end") or -1 to disable mods generation.

        See setModGenerationBaseDimension for details.

      • optionaltype: string

        Specifies what generator type to use. Default and the only currently available option is "mono", that is equivalent to creating a MonoBiomeTerrainGenerator.

    Returns CustomGenerator

overrideGeneratorForVanillaDimension

  • overrideGeneratorForVanillaDimension(id: number, generator: CustomGenerator): void
  • Overrides default generator of vanilla dimension.


    Parameters

    • id: number

      vanilla dimension ID, one of the EDimension values

    • generator: CustomGenerator

      custom landscape generator used for vanilla dimension

    Returns void

transfer

  • transfer(entity: number, dimensionId: number): void
  • Transfers specified entity to the dimension with specified ID.


    Parameters

    • entity: number

      numeric ID of the

    • dimensionId: number

      numeric ID of the dimension to transfer the entity to

    Returns void