Minecraft stacks on stacks6/29/2023 hover over/select the item in your inventory to see the lore.Ĭonst inventory = players.getComponent("inventory") as mc.EntityInventor圜omponent Examples diamondAwesomeSword.ts const diamondAwesomeSword = new mc.ItemStack(mc.MinecraftItemTypes.diamondSword, 1) ĭtLore() This function can't be called in read-only mode. If the item does not have lore, returns an empty array. Returns string - An array of lore strings. Returns the lore value - a secondary display string - for an ItemStack. Returns all components that are both present on this item stack and supported by the API. Returns ItemComponent | undefined Examples durability.ts // Get the maximum durability of a custom sword itemĬonst itemStack = new ItemStack("custom:sword") Ĭonst durability = itemStack.getComponent("minecraft:durability") as ItemDurabilit圜omponent Ĭonst maxDurability = durability.maxDurability If the component is not present on the item stack, undefined is returned. If no namespace prefix is specified, 'minecraft:' is assumed. The identifier of the component (e.g., 'minecraft:food') to retrieve. Gets a component (that represents additional capabilities) for an item stack. GetComponent(componentId: string): ItemComponent | undefined Its signature may change or it may be removed in future releases. Note that certain items can only have one item in the stack. The provided value will be clamped to the item's maximum stack size. Number of items to place in the stack, between 1-255. See the enumeration for a list of standard item types in Minecraft experiences. New ItemStack(itemType: ItemType | string, amount?: number)Ĭreates a new instance of a stack of items for use in the world. If a namespace is not specified, 'minecraft:' is assumed. Identifier of the type of items for the stack. Throws if the length exceeds 255 characters.
0 Comments
Leave a Reply. |