BlockSource
Index
Constructors
Methods
- addToTickingQueue
- breakBlock
- breakBlockForJsResult
- canSeeSky
- clip
- destroyBlock
- explode
- fetchEntitiesInAABB
- fetchEntitiesOfTypeInAABB
- getBiome
- getBiomeDownfallAt
- getBiomeTemperatureAt
- getBlock
- getBlockData
- getBlockEntity
- getBlockID
- getBlockId
- getBlockUpdateAllowed
- getBlockUpdateType
- getChunkState
- getChunkStateAt
- getDestroyParticlesEnabled
- getDimension
- getExtraBlock
- getGrassColor
- getLightLevel
- getLightningLevel
- getPointer
- getRainLevel
- isChunkLoaded
- isChunkLoadedAt
- listEntitiesInAABB
- listEntitiesOfTypeInAABB
- setBiome
- setBlock
- setBlockUpdateAllowed
- setBlockUpdateType
- setDestroyParticlesEnabled
- setExtraBlock
- setLightningLevel
- setRainLevel
- spawnDroppedItem
- spawnEntity
- spawnExpOrbs
- getCurrentClientRegion
- getCurrentWorldGenRegion
- getDefaultForActor
- getDefaultForDimension
- getFromCallbackPointer
- getFromServerCallbackPointer
- resetDefaultBlockSources
Constructors
constructor
Returns BlockSource
Methods
addToTickingQueue
Parameters
x: number
y: number
z: number
state: BlockState
delay: number
optionaltodo: number
Returns void
breakBlock
Destroys block on coords by entity using specified item or without it.
Parameters
x: number
y: number
z: number
allowDrop: boolean
whether to provide drop for the block or not
optionalentityUid: number
entity ID or -1 ID if entity is not specified
optionalitem: ItemInstance
tool which broke block
Returns void
breakBlockForJsResult
Same as breakBlock, but returns object containing drop and experience.
Parameters
x: number
y: number
z: number
optionalentityUid: number
entity ID or -1 ID if entity is not specified
optionalitem: ItemInstance
tool which broke block
Returns BlockBreakResult
canSeeSky
Parameters
x: number
y: number
z: number
Returns boolean
Whether the sky can be seen from coords.
clip
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
mode: number
certain modes also working with actors
output: number[]
Returns number
destroyBlock
Destroys block on coords producing appropriate drop and particles. Do not use for massive tasks due to particles being produced.
Parameters
x: number
y: number
z: number
optionaldrop: boolean
whether to provide drop for the block or not
Returns void
explode
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
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
optionaltype: number
entity type, since 2.3.1b115 could be used to fetch all entities via
0
or256
optionalblacklist: boolean
Returns number[]
Iterator 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 istrue
.
fetchEntitiesOfTypeInAABB
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
namespace: string
entity namespace, e.g. "minecraft"
type: string
entity type, e.g. "chicken"
Returns number[]
Iterator of entity IDs in given box, that are equal to the given type.
getBiome
Parameters
x: number
X coord of the block
z: number
Z coord of the block
Returns number
Biome ID.
getBiomeDownfallAt
Parameters
x: number
y: number
z: number
Returns number
Downfall of the biome on coords.
getBiomeTemperatureAt
Parameters
x: number
y: number
z: number
Returns number
Temperature of the biome on coords.
getBlock
Parameters
x: number
X coord of the block
y: number
Y coord of the block
z: number
Z coord of the block
Returns Tile | BlockState
Object of the block on given coords or Tile object in Legacy pack.
getBlockData
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
y: number
z: number
Returns NativeTileEntity
Interface to the vanilla TileEntity (chest, furnace, etc.) on the coords, and null if it's not found.
getBlockID
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.
getBlockId
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.
getBlockUpdateAllowed
Returns boolean
getBlockUpdateType
Returns number
getChunkState
Parameters
chunkX: number
X coord of the chunk
chunkZ: number
Z coord of the chunk
Returns number
Loading state of the chunk by chunk coords.
getChunkStateAt
Parameters
x: number
X coord of the position
z: number
Z coord of the position
Returns number
Loading state of the chunk by coords.
getDestroyParticlesEnabled
Returns boolean
getDimension
Returns number
Dimension ID to which the following object belongs.
getExtraBlock
Parameters
x: number
y: number
z: number
Returns BlockState
Object of the extra block on given coords.
getGrassColor
Parameters
x: number
z: number
Returns number
Grass color on chunk coords.
getLightLevel
Parameters
x: number
y: number
z: number
Returns number
Light level on the specified coordinates, from 0 to 15.
getLightningLevel
Returns number
getPointer
Returns number
getRainLevel
Returns number
isChunkLoaded
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
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
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
optionaltype: number
entity type, since 2.3.1b115 could be used to fetch all entities via
0
or256
optionalblacklist: boolean
Returns number[]
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 istrue
.
listEntitiesOfTypeInAABB
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
namespace: string
entity namespace, e.g. "minecraft"
type: string
entity type, e.g. "chicken"
Returns number[]
List of entity IDs in given box, that are equal to the given type.
setBiome
Sets biome ID by coords.
Parameters
chunkX: number
chunkZ: number
biomeID: number
ID of the biome to set
Returns void
setBlock
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
setBlockUpdateAllowed
Parameters
allowed: boolean
Returns void
setBlockUpdateType
Parameters
type: number
Returns void
setDestroyParticlesEnabled
Whether or not particles must be emitted when destroying blocks with this source.
Parameters
enabled: boolean
Returns void
setExtraBlock
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
optionaldata: number
Returns void
setLightningLevel
Parameters
level: number
Returns void
setRainLevel
Parameters
level: number
Returns void
spawnDroppedItem
Creates dropped item and returns entity ID.
Parameters
x: number
y: number
z: number
id: number
ID of the item to drop
count: number
count of the item to drop
data: number
data of the item to drop
optionalextra: ItemExtraData
extra of the item to drop
Returns number
Drop entity ID.
spawnEntity
Spawns entity of given numeric or namespaced type on coords.
Parameters
x: number
y: number
z: number
type: string | number
numeric entity type, e.g.
EEntityType.CHICKEN
or namespaced type with possible ommitions, e.g. "minecraft:chicken:", "minecraft:chicken", "chicken" does same
Returns number
spawnExpOrbs
Spawns experience orbs on coords.
Parameters
x: number
y: number
z: number
amount: number
experience amount
Returns void
staticgetCurrentClientRegion
Returns BlockSource
BlockSource for the current client.
staticgetCurrentWorldGenRegion
Returns BlockSource
BlockSource for world generation.
staticgetDefaultForActor
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).
staticgetDefaultForDimension
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).
staticgetFromCallbackPointer
Parameters
pointer: number
Returns BlockSource
staticgetFromServerCallbackPointer
Parameters
pointer: number
Returns BlockSource
staticresetDefaultBlockSources
Returns void
New class to work with world instead of some methods from World module.