Health and hunger system
This commit is contained in:
@@ -138,6 +138,18 @@ export interface BlockRegistry {
|
||||
compiled_states?: CompiledStateDefinition[];
|
||||
}
|
||||
|
||||
// what eating an item does, like minecraft's food properties
|
||||
export interface FoodProperties {
|
||||
// hunger points it restores, a bar is 20
|
||||
nutrition: number;
|
||||
// saturation it gives is nutrition * saturation_modifier * 2, like minecraft. bread's is 0.6
|
||||
saturation_modifier: number;
|
||||
// can be eaten when not hungry
|
||||
always_edible?: boolean;
|
||||
// what's left in the hand after, like a bowl after soup
|
||||
returns?: string;
|
||||
}
|
||||
|
||||
export interface ItemRegistry<T = unknown | undefined> {
|
||||
texture_id: string | ((item: ItemStack<T>) => string);
|
||||
// what players see, like "Iron Ingot". made from the id when not set, see display_name in common/utils.ts
|
||||
@@ -146,6 +158,7 @@ export interface ItemRegistry<T = unknown | undefined> {
|
||||
tool_type?: string;
|
||||
max_stack?: number;
|
||||
lore?: string;
|
||||
food?: FoodProperties;
|
||||
components?: Record<string, unknown>;
|
||||
|
||||
on_create?(item: ItemStack<T>): void;
|
||||
|
||||
Reference in New Issue
Block a user