Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • BlockSource

Index

Constructors

Methods

  • breakBlock(x: number, y: number, z: number, allowDrop: boolean, entity: number, item: ItemInstance): void
  • Destroys block on coords by entity using specified item.

    Parameters

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    • allowDrop: boolean

      whether to provide drop for the block or not

    • entity: number

      Entity id or -1 id if entity is not specified

    • item: ItemInstance

      Tool which broke block

    Returns void

  • breakBlockForJsResult(x: number, y: number, z: number, player: number, item: ItemInstance): { experience: number; items: ItemInstance[] }
  • Same as breakBlock, but returns object containing drop and experince.

    Parameters

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    • player: number
    • item: ItemInstance

      Tool which broke block

    Returns { experience: number; items: ItemInstance[] }

  • 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(x: number, y: number, z: number, drop?: boolean): void
  • Destroys block on coords producing appropriate drop and particles. Do not use for massive tasks due to particles being produced

    Parameters

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    • Optional drop: boolean

      whether to provide drop for the block or not

    Returns void

  • explode(x: number, y: number, z: number, power: number, fire: boolean): void
  • Creates an explosion on coords

    Parameters

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

      defines how many blocks can the explosion destroy and what blocks can or cannot be destroyed

    • fire: boolean

      if true, puts the crater on fire

    Returns void

  • 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(x: number, z: number): number
  • Parameters

    • x: number

      X coord of the block

    • z: number

      Z coord of the block

    Returns number

    biome id

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

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

    Returns number

    downfall of the biome on coords

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

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

    Returns number

    temperature of the biome on coords

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

    • x: number

      X coord of the block

    • y: number

      Y coord of the block

    • z: number

      Z coord of the block

    Returns BlockState

    BlockState object of the block on given coords or Tile object in Legacy pack

  • 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

  • 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, and null if it's not found

  • 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(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(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(): number
  • getExtraBlock(x: number, y: number, z: number): BlockState
  • getGrassColor(x: number, y: number, z: number): number
  • Parameters

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

    Returns number

    grass color on coords

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

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

    Returns number

    light level on the specified coordinates, from 0 to 15

  • 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(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

  • listEntitiesInAABB(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

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

    Parameters

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

    Returns void

  • setBlock(x: number, y: number, z: number, id: number, data: number): void
  • setBlock(x: number, y: number, z: number, state: BlockState): void
  • Sets block on 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 void

  • Sets block by given BlockState on coords

    Parameters

    Returns void

  • setDestroyParticlesEnabled(destroyParticlesEnabled: boolean): void
  • setExtraBlock(x: number, y: number, z: number, id: number, data: number): void
  • setExtraBlock(x: number, y: number, z: number, state: BlockState): void
  • Sets extra block (for example, water inside another blocks), on given coords by given id and data

    Parameters

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

    Returns void

  • Sets extra block (for example, water inside another blocks), on given coords by given BlockState

    Parameters

    Returns void

  • 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

    • Optional extra: ItemExtraData

      extra of the item to drop

    Returns number

    drop entity id

  • spawnEntity(x: number, y: number, z: number, type: string | number): number
  • spawnEntity(x: number, y: number, z: number, namespace: string, type: string, spawnEvent: string): number
  • Spawns entity of given numeric type on coords

    Parameters

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

      entity type name

    Returns number

  • Spawns entity of given type on coords with specified spawn event.

    Parameters

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

      namespace of the entity type: 'minecraft' or from add-on.

    • type: string

      entity type name

    • spawnEvent: string

      built-in event for entity spawn. Use 'minecraft:entity_born' to spawn baby mob.

    Returns number

  • spawnExpOrbs(x: number, y: number, z: number, amount: number): void
  • Spawns experience orbs on coords

    Parameters

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

      experience amount

    Returns void

  • Parameters

    • entityUid: number

    Returns 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)

  • Parameters

    • dimension: number

    Returns BlockSource

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

Generated using TypeDoc