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

CustomBiome

Class used to create custom biomes. Note that Minecraft has a limit of 256 biomes and there are already more than 100 vanilla biomes, so do not overuse this functionality.

Index

Constructors

constructor

  • Crates a new custom biome with specified string identifier.


    Parameters

    • name: string

      string identifier of the biome

    Returns CustomBiome

Properties

readonlyid

id: number

custom biome numeric ID.

readonlyname

name: string

Custom biome name.

readonlypointer

pointer: number

Pointer to biome's native object, represented as long number.

Methods

isInvalid

  • isInvalid(): boolean
  • Returns boolean

    Whether biome is invalid.

setAdditionalBlock

  • setAdditionalBlock(id: number, data: number): CustomBiome
  • Specifies the block that will cover the biome. E.g. most of the biomes use grass as cover block, though some of the biomes use other blocks (sand, ice, etc.).

    That feature is obsolete

    Parameters

    • id: number

      block's tile ID

    • data: number

      block data

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setClientJson

  • since: 2.2.0b1 pre-alpha

    Defines the client-side biome params from given JSON string.

    Invocation may throw an error

    Java java.lang.IllegalArgumentException if the string cannot be parsed.

    Learn how to use

    Many thanks to DansZbar2 for the example!

    const CHERRY_BIOME = new CustomBiome("environmental_cherry");
    CHERRY_BIOME.setClientJson(JSON.stringify({
    "water_surface_color": "#d176e1",
    "water_fog_color": "#a35dc2",
    "water_surface_transparency": 0.7,
    "water_fog_distance": 11,
    // custom fog defined in the addon
    "fog_identifier": "environmental:environmental_cherry"
    }));

    Parameters

    • json: string

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setCoverBlock

  • Specifies the block that will cover the biome; e.g., most of the biomes use grass as cover block, though some of the biomes use other blocks (sand, ice, etc.).


    Parameters

    • id: number

      block's tile ID

    • data: number

      block data

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setFillingBlock

  • Sets the block that fills the terrain. Vanilla biomes use stone filling.


    Parameters

    • id: number

      block's tile ID

    • data: number

      block data

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setFoliageColor

  • Sets biome's foliage color.


    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 CustomBiome

    Reference to itself to be used in sequential calls.

setGrassColor

  • Sets biome's grass color. Grass color is interpolated on the bounds of the biome.


    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 CustomBiome

    Reference to itself to be used in sequential calls.

setSeaFloorBlock

  • setSeaFloorBlock(id: number, data: number): CustomBiome
  • since: 2.2.0b1 pre-alpha

    Sets the block that fills the floor at the bottom of the sea or the ocean. Vanilla biomes use gravel or stone filling.


    Parameters

    • id: number

      block's tile ID

    • data: number

      block data

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setSeaFloorDepth

  • since: 2.2.0b1 pre-alpha

    Sets the average depth of the sea floor in this biome.


    Parameters

    • depth: number

      depth of the see floor by Y-axis.

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setServerJson

  • since: 2.2.0b1 pre-alpha

    Defines the server-side biome params from given JSON string.

    Invocation may throw an error

    Java java.lang.IllegalArgumentException if the string cannot be parsed.

    Learn how to use

    Many thanks to DansZbar2 for the example!

    const CHERRY_BIOME = new CustomBiome("environmental_cherry");
    CHERRY_BIOME.setServerJson(JSON.stringify({
    "minecraft:climate": {
    "downfall": 0.0,
    "snow_accumulation": [ 0.0, 0.0 ],
    "temperature": 2.0,
    "blue_spores": 0,
    "red_spores": 0,
    "white_ash": 0,
    "ash": 0
    },
    "minecraft:overworld_height": {
    "noise_type": "default"
    },
    "animal": {},
    "monster": {},
    "overworld": {},
    "environmental_cherry": {},
    "minecraft:surface_parameters": {
    "top_material": "minecraft:grass",
    "mid_material": "minecraft:dirt",
    "foundation_material": "minecraft:stone",
    "sea_floor_material": "minecraft:clay",
    "sea_material": "minecraft:water",
    "sea_floor_depth": 7
    },
    "minecraft:overworld_generation_rules": {
    "hills_transformation": "jungle_hills",
    "generate_for_climates": [
    [ "cold", 5 ],
    [ "medium", 20 ],
    [ "warm", 35 ]
    ]
    }
    }));

    Parameters

    • json: string

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setSkyColor

  • since: 2.4.0b120

    Sets biome's sky color.


    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 CustomBiome

    Reference to itself to be used in sequential calls.

setSurfaceBlock

  • Specifies the block that will be under the covering block of the biome; e.g., most of the biomes use dirt as cover block, though some of the biomes use other blocks.


    Parameters

    • id: number

      block's tile ID

    • data: number

      block data

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setSurfaceParam

  • since: 2.2.0b1 pre-alpha

    Sets the average depth of the something in this biome.

    That feature is obsolete

    Parameters

    • depth: number

      surface depth parameter.

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setTemperatureAndDownfall

  • setTemperatureAndDownfall(temperature: number, downfall: number): CustomBiome
  • Sets biome's temperature and downfall.


    Parameters

    • temperature: number

      temperature value, from 0 to 1

    • downfall: number

      downfall value, from 0 to 1

    Returns CustomBiome

    Reference to itself to be used in sequential calls.

setWaterColor

  • Sets biome's water color.


    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 CustomBiome

    Reference to itself to be used in sequential calls.

staticgetAllCustomBiomes

  • since: 2.2.1b93

    Returns Map<String, CustomBiome>

    Object instance, with all custom biomes registered by every mod.

staticreset

  • reset(): void
  • since: 2.3.1b116internal

    Called when server stopped to cleanup biome synced IDs.


    Returns void

staticupdateNativeId

  • since: 2.3.1b116internal

    Called when server detection packet received.


    Parameters

    Returns void