lazuli-api
Version:
Add some useful instances for Minecraft Bedrock Edition
31 lines (29 loc) • 827 B
text/typescript
import { ItemCompleteUseAfterEvent } from "@minecraft/server";
import { EffectData } from "lazuli-common";
/**
* Define a food item.
* @category Need Registry
*/
export class FoodItem {
constructor(
/**
* Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed.
*/
readonly typeId: string,
/**
* Adds a status effect when eat the food.
*/
public statusEffects?: EffectData[],
/**
* This event fires when eat the food.
*/
public eatEvent?: (arg: ItemCompleteUseAfterEvent) => void
) {}
/**
* Registry the food.
* @deprecated Use `Register.foodRegistry()` to registry the food.
*/
protected register() {
console.warn("[Lazuli] The register method was deprecated!");
}
}