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.
Parameters
name: string
string block ID. Used in Block module functions and in some other block-related functions. Inner Core converts it to block_
<name>as minecraft vanilla block ID to avoid string ID clashes
Returns number
Numeric block ID.
genItemID
Generates a new numeric item ID.
Parameters
name: string
string item ID. Used in Item module functions and in some other item-related functions. Inner Core converts it to item_
<name>as minecraft vanilla item ID to avoid string ID clashes
Returns number
Numeric item ID.
getIdInfo
Gets type of item ("block" or "item") and it's string ID in Minecraft.
Parameters
id: number
numeric item or block ID
Returns string
String in format
"type:string_id"
or"type:string_id#extra_information"
.
getNameByID
Gets known modded item or block string ID by it's numeric ID.
Parameters
id: number
numeric item or block ID
Returns string
getStringIdAndTypeForIntegerId
Gets type of item ("block" or "item") and it's string ID in Minecraft.
Parameters
id: number
numeric item or block ID
Returns string
String in format
"type:string_id"
.
getStringIdAndTypeForItemId
Gets unique identifier of item or block string ID by it's numeric ID. IDs represented in format
type:identifier#extra
, e.g.item:ruby_shovel
orblock:ancient_debris#negative
,Parameters
id: number
numeric item or block ID
Returns Nullable<string>
getStringIdForIntegerId
Gets item string ID in Minecraft.
Parameters
id: number
numeric item or block ID
Returns string
Represent of named identifier.
getStringIdForItemId
Gets item or block string ID by it's numeric ID.
Parameters
id: number
numeric item or block ID
Returns Nullable<string>
getTypeForIntegerId
Gets type of item ("block" or "item").
Parameters
id: number
numeric item or block ID
Returns string
Represent of type.
getTypeForItemId
Gets ID type by specific numeric ID.
Parameters
id: number
numeric item or block ID
Returns Nullable<block | item>
isVanilla
Parameters
id: number
numeric item or block ID
Returns boolean
true
if item is vanilla Minecraft item,false
otherwise.
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).