Namespace IDRegistry

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

Functions

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

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

  • 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_ as minecraft vanilla block ID to avoid string ID clashes

    Returns number

    Numeric block ID.

  • 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_ as minecraft vanilla item ID to avoid string ID clashes

    Returns number

    Numeric item ID.

  • 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".

  • Gets known modded item or block string ID by it's numeric ID.

    Parameters

    • id: number

      numeric item or block ID

    Returns string

  • 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".

    2.2.1b94

  • 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 or block:ancient_debris#negative,

    Parameters

    • id: number

      numeric item or block ID

    Returns Nullable<string>

    2.2.1b94

  • Gets item string ID in Minecraft.

    Parameters

    • id: number

      numeric item or block ID

    Returns string

    Represent of named identifier.

    2.2.1b94

  • Gets item or block string ID by it's numeric ID.

    Parameters

    • id: number

      numeric item or block ID

    Returns Nullable<string>

    2.2.1b94

  • Gets type of item ("block" or "item").

    Parameters

    • id: number

      numeric item or block ID

    Returns string

    Represent of type.

    2.2.1b94

  • Gets ID type by specific numeric ID.

    Parameters

    • id: number

      numeric item or block ID

    Returns Nullable<"block" | "item">

    2.2.1b94

  • Parameters

    • id: number

      numeric item or block ID

    Returns boolean

    true if item is vanilla Minecraft item, false otherwise.

    2.2.1b102

Variables

BLOCK_ID_OFFSET: number

Defines the numeric ID of the first user-defined block.

ITEM_ID_OFFSET: number

Defines the numeric ID of the first user-defined item.

MAX_ID: number

Defines maximum item/block ID.

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.