Creates new block using specified params.
string ID of the block. You should register it via IDRegistry.genBlockID call first
array containing all variations of the block. Each variation corresponds to block data value, data values are assigned according to variations order
Optional
blockType: string | SpecialTypeBlock.SpecialType object, either java-object returned by Block.createSpecialType or js-object with the required properties, you can also pass special type name, if the type was previously registered
Creates new block using specified params, creating four variations for each of the specified variations to be able to place it facing flayer with the front side and defines the appropriate behavior. Useful for different machines and mechanisms.
string ID of the block. You should register it via IDRegistry.genBlockID call first
array containing all variations of the block. Each variation corresponds to four block data values, data values are assigned according to variations order
Optional
blockType: string | SpecialTypeSpecialType object, either java-object returned by Block.createSpecialType or js-object with the required properties, you can also pass special type name, if the type was previously registered
Creates new liquid block using specified params.
string ID of the block. You should register it via IDRegistry.genBlockID call first
object containing all needed params to describe your custom liquid block. There you can specify custom name IDs for static and dynamic liquid blocks separately, and if you do this, you have to register those name IDs via IDRegistry.genBlockID before using them
Optional
blockType: string | SpecialTypeSpecialType object, either java-object returned by Block.createSpecialType or js-object with the required properties, you can also pass special type name, if the type was previously registered
Creates a new special type using specified params and optionally registers it by name.
special type properties
Optional
name: stringstring name to register the special type
Special type name.
Gets drop for the specified block. Used mostly by Core Engine's ToolAPI, though, can be useful in the mods, too.
block info
item that was (or is going to be) used to break the block
coordinates where the block was (or is going to be) broken
Block drop, the array of arrays, each containing three values: ID, count and data respectively.
Drop function of the block with given numeric ID.
Place function of the block with given numeric ID, or undefined if it was not specified.
Defines custom behavior when the player clicks on the block with definite ID.
block's numeric or string ID
function that will be called when the player clicks the block with given ID
Defines custom behavior when the player clicks on the block with definite ID.
block's numeric ID
function that will be called when the player clicks the block with given ID
Registers function used by Core Engine to determine block drop for the specified block ID.
tile string or numeric ID
function to be called to determine what will be dropped when the block is broken
Optional
level: numberif level is specified and is not 0, digging level of the block is additionally set
true
, if specified string or numeric ID exists and the function
was registered correctly, false
otherwise.
Registers function used by Core Engine to determine block drop for the specified block ID.
tile numeric ID
function to be called to determine what will be dropped when the block is broken
Optional
level: numberif level is specified and is not 0, digging level of the block is additionally set
true
, if specified string or numeric ID exists and the function
was registered correctly, false
otherwise.
Registers function on entity being inside the block. Can be used to create portals.
tile string or numeric ID
function to be called when entity is inside the block
true
, if the function was registered correctly, false
otherwise.
Registers function on entity being inside the block. Can be used to create portals.
tile string or numeric ID
function to be called when entity is inside the block
true
, if the function was registered correctly, false
otherwise.
Registers function on entity step on the block.
tile string or numeric ID
function to be called when entity step on the block
true
, if the function was registered correctly, false
otherwise.
Registers function on entity step on the block.
tile numeric ID
function to be called when entity step on the block
true
, if the function was registered correctly, false
otherwise.
Registers function on neighbour blocks updates.
tile string or numeric ID
function to be called when neighbour block updates
true
, if the function was registered correctly, false
otherwise.
Registers function on neighbour blocks updates.
tile numeric ID
function to be called when neighbour block updates
true
, if the function was registered correctly, false
otherwise.
Registers function to be called when the block is placed in the world.
block numeric or string ID
function to be called when the block is placed in the world
Registers function to be called when the block is placed in the world.
block numeric ID
function to be called when the block is placed in the world
Registered function used by Core Engine to determine block drop for the specified block ID.
tile string or numeric ID
function to be called when a block in the world is broken by environment (explosions, pistons, etc.)
true
, if specified string or numeric ID exists and the function
was registered correctly, false
otherwise.
Registered function used by Core Engine to determine block drop for the specified block ID.
tile numeric ID
function to be called when a block in the world is broken by environment (explosions, pistons, etc.)
true
, if specified string or numeric ID exists and the function
was registered correctly, false
otherwise.
Makes block invoke callback randomly depending on game speed. Occurs more often then Block.setRandomTickCallback and only if the block is not far away from player.
block ID to register
function to be called
Registers material and digging level for the specified block.
block numeric or string ID
material name
block's digging level
true
if specified string or numeric ID exists, false
otherwise.
Sets block box shape, like Block.setShape, but in voxel objects for each coordinate.
Registers a default destroy function for the specified block, considering it's digging level.
tile string or numeric ID
digging level of the block
Optional
resetData: booleanif true, the block is dropped with data equals to 0
Registers a default destroy function for the specified block, considering it's digging level.
tile numeric ID
digging level of the block
Optional
resetData: booleanif true, the block is dropped with data equals to 0
Better performance should be inherited by manually manipulation with properties and special type.
Makes block invoke callback randomly depending on game speed.
block ID to register for random ticks
function to be called on random block tick
Makes block accept redstone signal.
block numeric or string ID
block data, currently not used
if true, the redstone changes at the block will notify the "RedstoneSignal" callback
Use Block.setupAsRedstoneReceiver and Block.setupAsRedstoneEmitter instead.
Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.
Module used to create and manipulate blocks. The difference between terms "block" and "tile" is in it's usage: blocks are used in the inventory, tiles are placed in the world and have different IDs for some vanilla blocks. Use Block.convertBlockToItemId and Block.convertItemToBlockId to perform conversion between block and it item variation.