Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockSource

New class to work with world instead of some methods from World module.

Hierarchy

  • BlockSource

Index

Methods

canSeeSky

  • canSeeSky(x: number, y: number, z: number): boolean
  • Parameters

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

    Returns boolean

    whether the sky can be seen from coords

destroyBlock

  • destroyBlock(x: number, y: number, z: number): void
  • destroyBlock(x: number, y: number, z: number, drop: boolean): void

explode

  • explode(x: number, y: number, z: number, power: number, fire: boolean): void
  • Parameters

    • x: number
    • y: number
    • z: number
    • power: number
    • fire: boolean

    Returns void

fetchEntitiesInAABB

  • fetchEntitiesInAABB(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, type: number, blacklist: boolean): number[]
  • Parameters

    • x1: number
    • y1: number
    • z1: number
    • x2: number
    • y2: number
    • z2: number
    • type: number
    • blacklist: boolean

    Returns number[]

    the list of entity IDs in given box, that are equal to the given type, if blacklist value is false, and all except the entities of the given type, if blacklist value is true

getBiome

  • getBiome(x: number, z: number): number
  • Parameters

    • x: number

      X coord of the block

    • z: number

      Z coord of the block

    Returns number

    biome id

getBiomeTemperatureAt

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

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

    Returns number

    temperature of the biome on coords

getBlock

  • getBlock(x: number, y: number, z: number): Tile
  • Parameters

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    Returns Tile

    Tile object with id and data propeties

getBlockData

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

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    Returns number

    block's data at coords

getBlockEntity

  • Parameters

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    Returns NativeTileEntity

    interface to the vanilla TileEntity (chest, furnace, etc.) on the coords

getBlockId

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

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    Returns number

    block's id at coords

getChunkState

  • getChunkState(chunkX: number, chunkZ: number): number
  • Parameters

    • chunkX: number

      X coord of the chunk

    • chunkZ: number

      Z coord of the chunk

    Returns number

    the loading state of the chunk by chunk coords

getChunkStateAt

  • getChunkStateAt(x: number, z: number): number
  • Parameters

    • x: number

      X coord of the position

    • z: number

      Z coord of the position

    Returns number

    the loading state of the chunk by coords

getDimension

  • getDimension(): number

getGrassColor

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

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

    Returns number

    grass color on coords

isChunkLoaded

  • isChunkLoaded(chunkX: number, chunkZ: number): boolean
  • Parameters

    • chunkX: number

      X coord of the chunk

    • chunkZ: number

      Z coord of the chunk

    Returns boolean

    true if chunk is loaded, false otherwise

isChunkLoadedAt

  • isChunkLoadedAt(x: number, z: number): boolean
  • Parameters

    • x: number

      X coord of the position

    • z: number

      Z coord of the position

    Returns boolean

    true if chunk on the position is loaded, false otherwise

setBiome

  • setBiome(x: number, z: number, biomeID: number): void
  • Sets biome id by coords

    Parameters

    • x: number
    • z: number
    • biomeID: number

    Returns void

setBlock

  • setBlock(x: number, y: number, z: number, id: number, data: number): number
  • Sets block by the coords

    Parameters

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

      id of the block to set

    • data: number

      data of the block to set

    Returns number

spawnDroppedItem

  • spawnDroppedItem(x: number, y: number, z: number, id: number, count: number, data: number, extra: ItemExtraData): number
  • Creates dropped item and returns entity id

    Parameters

    • x: number

      X coord of the place where item will be dropped

    • y: number

      Y coord of the place where item will be dropped

    • z: number

      Z coord of the place where item will be dropped

    • id: number

      id of the item to drop

    • count: number

      count of the item to drop

    • data: number

      data of the item to drop

    • extra: ItemExtraData

      extra of the item to drop

    Returns number

    drop entity id

spawnEntity

  • spawnEntity(x: number, y: number, z: number, type: number): number
  • spawnEntity(x: number, y: number, z: number, type: string): number
  • spawnEntity(x: number, y: number, z: number, namespace: string, type: string, init_data: string): number
  • Parameters

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

    Returns number

  • Parameters

    • x: number
    • y: number
    • z: number
    • type: string

    Returns number

  • Parameters

    • x: number
    • y: number
    • z: number
    • namespace: string
    • type: string
    • init_data: string

    Returns number

spawnExpOrbs

  • spawnExpOrbs(x: number, y: number, z: number, amount: number): void

Static getCurrentWorldGenRegion

Static getDefaultForActor

  • Parameters

    • entityUid: number

    Returns Nullable<BlockSource>

    interface to the dimension where the given entity is (null if given entity does not exist or the dimension is not loaded and interface was not created)

Static getDefaultForDimension

  • Parameters

    • dimension: number

    Returns Nullable<BlockSource>

    interface to given dimension by default (null if given dimension is not loaded and this interface was not created yet)

Generated using TypeDoc