Curios and artifacts !
This commit is contained in:
@@ -227,6 +227,21 @@ export interface Player {
|
||||
feed(nutrition: number, saturation_modifier: number): void;
|
||||
// tires them out: 4 costs a point of saturation, or of hunger once it's gone
|
||||
add_exhaustion(amount: number): void;
|
||||
// their stats, like minecraft's attributes: "bworld:attack_damage", "bworld:attack_speed", "bworld:max_health"...
|
||||
// see docs/modding/entities/players.md. modifiers aren't saved, they're gone when the player leaves
|
||||
attribute(id: Id): number;
|
||||
// replaces one with the same id on that attribute
|
||||
add_modifier(attribute: Id, modifier: AttributeModifier): void;
|
||||
// whether it had it
|
||||
remove_modifier(attribute: Id, id: string): boolean;
|
||||
}
|
||||
|
||||
// like minecraft's: the base, plus every add_value, plus that times each add_multiplied_base, then times 1 + each
|
||||
// add_multiplied_total
|
||||
export interface AttributeModifier {
|
||||
id: string;
|
||||
amount: number;
|
||||
operation: "add_value" | "add_multiplied_base" | "add_multiplied_total";
|
||||
}
|
||||
|
||||
export interface PlayerList {
|
||||
@@ -272,6 +287,9 @@ export interface ItemApi {
|
||||
max_stack(id: Id): number;
|
||||
// the tool type it is, like "pickaxe" or "shovel", from the item's "tool"
|
||||
tool(id: Id): string | undefined;
|
||||
// the components its json lists and their params, a copy. a mod can read params of its components this way
|
||||
// without a stack, like curios does for curios:attribute_modifiers
|
||||
components(id: Id): Record<Id, unknown>;
|
||||
}
|
||||
|
||||
export interface RecipeApi {
|
||||
@@ -328,6 +346,8 @@ export interface ContainerScreenOptions {
|
||||
output_only?: boolean;
|
||||
// runs when a player takes from an output_only slot, before they get it. false stops them taking it
|
||||
on_take?: (item: ItemStack) => boolean;
|
||||
// a texture drawn in the slot while it's empty, like minecraft's armor slots
|
||||
icon?: Id;
|
||||
}[];
|
||||
// height of the screen's area in slots, fits the layout and bars when not set
|
||||
rows?: number;
|
||||
|
||||
Reference in New Issue
Block a user