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 effects that are applied when the food is consumed.

      Returns { amplifier: number; chance: number; duration: number; id: number }[]

      An array of the effect info.

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