Make the fishing loot table be generated from the fish items
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// what server scripts get, see docs/modding/
|
||||
import type { EventSignal, Face, Id, ItemStack, ModInfo, Position, Season, TagApi } from "./shared.ts";
|
||||
import type { ArgumentType, CommandNode } from "../commands.ts";
|
||||
import type { LootTableJson } from "../loot.ts";
|
||||
|
||||
export type { ArgumentType, CommandContext, CommandNode, Suggestion } from "../commands.ts";
|
||||
|
||||
@@ -375,6 +376,8 @@ export interface ContainerApi {
|
||||
|
||||
export interface ItemApi {
|
||||
exists(id: Id): boolean;
|
||||
// every item, in load order
|
||||
ids(): Id[];
|
||||
// how many fit in one slot
|
||||
max_stack(id: Id): number;
|
||||
// the tool type it is, like "pickaxe" or "shovel", from the item's "tool"
|
||||
@@ -443,6 +446,9 @@ export interface LootApi {
|
||||
// changes what a table gives every time it's rolled, or every table's with "*", like neoforge's global loot
|
||||
// modifiers. return the new items, or change the list. only during setup
|
||||
modify(table: Id | "*", fn: (items: ItemStack[], context: LootContext, table: Id) => ItemStack[] | void): void;
|
||||
// a table made by the script instead of a file, like the base game's fishing table built from its fish. the json
|
||||
// is what a file's "loot_table" is, the id is in the mod's namespace. only during setup
|
||||
register_table(id: Id, table: Omit<LootTableJson, "id">): void;
|
||||
}
|
||||
|
||||
// forms, not built yet: menus whose screens the engine provides, see docs/modding_plan.md
|
||||
|
||||
Reference in New Issue
Block a user