Class FoodItem

Define a food item.

Constructors

Properties

Methods

Constructors

  • Parameters

    • typeId: string

      Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed.

    • OptionalstatusEffects: EffectData[]

      Adds a status effect when eat the food.

    • OptionaleatEvent: ((arg: ItemCompleteUseAfterEvent) => void)

      This event fires when eat the food.

        • (arg): void
        • Parameters

          • arg: ItemCompleteUseAfterEvent

          Returns void

    Returns FoodItem

Properties

eatEvent?: ((arg: ItemCompleteUseAfterEvent) => void)

This event fires when eat the food.

statusEffects?: EffectData[]

Adds a status effect when eat the food.

typeId: string

Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed.

Methods

  • Registry the food.

    Returns void

    Use Register.foodRegistry() to registry the food.