SerenityJS
    Preparing search index...
    Index

    Constructors

    Properties

    blocks: Map<bigint, Block> = ...

    The blocks in the dimension that contain data.

    entities: Map<bigint, Entity> = ...

    The entities in the dimension.

    generator: TerrainGenerator

    The generator of the dimension.

    identifier: string

    The identifier of the dimension.

    properties: DimensionProperties = DefaultDimensionProperties

    The properties of the dimension.

    serenity: Serenity

    The serenity instance of the server.

    type: DimensionType

    The type of the dimension.

    world: World

    The world that the dimension belongs to.

    Accessors

    Methods

    • Broadcast packets to all the players in the dimension.

      Parameters

      • ...packets: DataPacket[]

        The packets to broadcast.

      Returns void

    • Broadcast packets to all the players in the dimension except the specified player.

      Parameters

      • excludedPlayer: Player
      • ...packets: DataPacket[]

        The packets to broadcast.

      Returns void

    • Broadcast packets to all the players in the dimension immediately. This will bypass the RakNet queue and send the packets immediately.

      Parameters

      • ...packets: DataPacket[]

        The packets to broadcast.

      Returns void

    • Fills a region with a permutation.

      Parameters

      • from: IPosition

        The starting position.

      • to: IPosition

        The ending position.

      • permutation: BlockPermutation

        The permutation to fill the region with.

      Returns number

      The amount of blocks that were filled.

    • Gets a chunk from the dimension.

      Parameters

      • cx: number

        The chunk x coordinate.

      • cz: number

        The chunk z coordinate.

      Returns Chunk

      The chunk at the specified coordinates.

    • Gets an entity from the dimension.

      Parameters

      • id: bigint

        The id of the entity, either unique id or runtime id.

      • runtimeId: boolean = false

        Whether to get the entity by runtime id; defaults to false.

      Returns null | Entity

      The entity if found, otherwise null.

    • Get the permutation of a block at a given position. This method won't construct a block instance.

      Parameters

      • position: IPosition

        The position of the block.

      • layer: number = 0

      Returns BlockPermutation

      The block permutation at the specified position.

    • Gets the topmost block in which the permutation is not air, at the given X and Z coordinates.

      Parameters

      • position: IPosition

        The position to query.

      Returns Block

      The topmost block in which the permutation is not air.

    • Ticks the dimension with a given delta tick.

      Parameters

      • deltaTick: number

        The delta tick to tick the dimension with.

      Returns void

    • Broadcasts a message to all players in the dimension.

      Parameters

      • message: string

        The message to broadcast.

      Returns void

    • Sets the permutation of a block at a given position.

      Parameters

      • position: IPosition

        The position of the block.

      • permutation: BlockPermutation

        The permutation to set.

      • layer: UpdateBlockLayerType = UpdateBlockLayerType.Normal

        The layer to set the permutation on.

      Returns void