IDRegistry
Index
Variables
constBLOCK_ID_OFFSET
Defines the numeric ID of the first user-defined block.
constITEM_ID_OFFSET
Defines the numeric ID of the first user-defined item.
constMAX_ID
Defines maximum item/block ID.
Functions
ensureBlockId
Ensures given ID is a tile ID, not a block ID. It is generally recommended to use Block.convertItemToBlockId since it performs less calculations.
Parameters
id: number
block or tile ID
Returns number
Tile ID.
ensureItemId
Ensures given ID is a block ID, not a tile ID. It is generally recommended to use Block.convertBlockToItemId since it performs less calculations.
Parameters
id: number
block or tile ID
Returns number
Block ID.
genBlockID
Generates a new numeric block ID. Used in Block module functions and in some other block-related functions.
Parameters
name: string
string block ID; Inner Core converts it to block_<name> as minecraft vanilla block ID to avoid string ID clashes (since 3.1.0b126 support namespaces, should be namespace:snake_case)
Returns number
Numeric block ID.
Module used to manage item and block IDs. Items and blocks have the same underlying nature, so their IDs are interchangeable. Though, the blocks are defined "twice", as an item (in player's hand or inventory) and as a tile (a block placed in the world).