@ascentbv/ts-common - v1.0.123
    Preparing search index...

    Class ItemUtilAbstract

    Index

    Constructors

    Methods

    • Gets the base name of an item (without namespace).

      Parameters

      Returns string

      The base name (e.g., "stone" for "minecraft:stone").

      const baseName = ItemUtil.getBaseItemName(item);
      console.log(baseName); // stone
    • Returns a new ItemStack with the settings applied

      Parameters

      • typeId: string

        The typeId of the item stack to make

      • amount: number = 1

        The amount of items in the item stack. Defaults to 1.

      • Optionallore: RawMessage | RawMessage[]

        The lore to add to the ItemStack.

      • Optionaldata: ItemStackData

        Additional item data to add such as ItemLockMode or KeepOnDeath

      Returns ItemStack

      The ItemStack that was created