SerenityJS
    Preparing search index...

    Class ItemStackFoodTrait

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    canAlwaysEat: boolean = false

    Whether the item can always be eaten, regardless of the player's hunger level.

    identifier: string = ...

    The identifier of the trait.

    item: ItemStack

    The item stack that this trait is attached to.

    nutrition: number = 1

    The nutrition value of the food item. This value can be negative, which would result in hunger loss.

    saturationModifier: number = 1

    The saturation modifier of the food item. This value must be greater than 0.

    component: typeof ItemTypeFoodComponent = ItemTypeFoodComponent

    The item component that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.

    identifier: "food"

    The identifier of the trait.

    tag: null | string = null

    The item tag that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.

    types: string[] = []

    The item type identifiers that this trait is compatible with by default.

    Methods