SerenityJS
    Preparing search index...

    Class ItemTypeFoodComponent

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    The component collection of the item type.

    conversionItemType: null | ItemType = null

    The item type that this food component converts to when used.

    identifier: string = ...

    The component identifier of the item type.

    type: ItemType

    The item type of the component.

    identifier: "minecraft:food"

    The component identifier of the item type.

    Accessors

    Methods

    • Get the nutrition value of the item.

      Returns number

      The nutrition value of the item, defaulting to 0 if not found.

      This value can be negative, which would result in hunger loss.

    • Set the nutrition value of the item.

      Parameters

      • value: number

        The nutrition value to set for the item.

      Returns void

      This value can be negative, which would result in hunger loss.