Lava fishing

This commit is contained in:
2026-10-11 19:12:38 -03:00
parent 870235442b
commit 67e8fe5c00
13 changed files with 167 additions and 40 deletions
+14 -14
View File
@@ -173,19 +173,19 @@ catch up. If it's further behind than that, it skips the rest and logs a warning
`mods/bworld/scripts/server.ts` registers these, and any mod that depends on `bworld` can use them:
| Component | Params | What it does |
| ----------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bworld:storage` | `rows` | A chest: `rows` × 9 slots, dropped when it's broken. |
| `bworld:shipping_bin` | `rows` | Like `bworld:storage`, and every morning at 06:00 sells what's in it with a `base_sell_value` for coins. |
| `bworld:furnace` | none | Smelts with `furnace` and `fuel` [recipes](../resources/recipes.md). Needs `lit` and `facing` states, see `blocks/furnace.json`. |
| `bworld:smithing_table` | none | Upgrades tools with `smithing` recipes. |
| `bworld:hoeable` | `tool`, `into` | Right clicking with a tool of type `tool` turns it into `into`, like a hoe on grass. |
| `bworld:farmland` | none | Watered with the watering can, dries out every morning. |
| `bworld:crop` | see [Crops](crops.md) | Grows a stage every morning its farmland was watered. |
| `bworld:crop_top` | see [Crops](crops.md) | The top half of a two block crop, like rice. |
| `bworld:water_source` | none | Refills the watering can. |
| `bworld:fishable` | none | The fishing rod's hook floats on it and fish bite there when it lands in it. |
| `bworld:trapdoor` | none | Opens and closes when right clicked, and is placed like Minecraft's (both are rules, in the shared script). Needs `facing` (2 bits), `half` and `open` states, see `blocks/oak_trapdoor.json`. |
| `bworld:fence` | `connects_to` | Joins the blocks in the tag `connects_to` and sturdy sides of other blocks, except leaves. Needs the `north`, `east`, `south` and `west` states. |
| Component | Params | What it does |
| ----------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bworld:storage` | `rows` | A chest: `rows` × 9 slots, dropped when it's broken. |
| `bworld:shipping_bin` | `rows` | Like `bworld:storage`, and every morning at 06:00 sells what's in it with a `base_sell_value` for coins. |
| `bworld:furnace` | none | Smelts with `furnace` and `fuel` [recipes](../resources/recipes.md). Needs `lit` and `facing` states, see `blocks/furnace.json`. |
| `bworld:smithing_table` | none | Upgrades tools with `smithing` recipes. |
| `bworld:hoeable` | `tool`, `into` | Right clicking with a tool of type `tool` turns it into `into`, like a hoe on grass. |
| `bworld:farmland` | none | Watered with the watering can, dries out every morning. |
| `bworld:crop` | see [Crops](crops.md) | Grows a stage every morning its farmland was watered. |
| `bworld:crop_top` | see [Crops](crops.md) | The top half of a two block crop, like rice. |
| `bworld:water_source` | none | Refills the watering can. |
| `bworld:fishable` | `loot_table`? | The fishing rod's hook floats on it and fish bite there when it lands in it. What's caught is `loot_table`, `bworld:gameplay/fishing` when not given, built from the fish whose `liquid` is this block. |
| `bworld:trapdoor` | none | Opens and closes when right clicked, and is placed like Minecraft's (both are rules, in the shared script). Needs `facing` (2 bits), `half` and `open` states, see `blocks/oak_trapdoor.json`. |
| `bworld:fence` | `connects_to` | Joins the blocks in the tag `connects_to` and sturdy sides of other blocks, except leaves. Needs the `north`, `east`, `south` and `west` states. |
Item components work the same way, see [Items](../items/index.md#item-components).
+12 -9
View File
@@ -121,20 +121,22 @@ does nothing unless they hold.
## Where Tables Are Used
| What | How |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [Blocks](../blocks/index.md) | `"loot_table"` in the block's json, rolled when it breaks, with its states and the tool. `"drops"` is the shorthand for one of an item. |
| [Mobs](../entities/index.md) | `"loot_table"` in the entity's json, rolled when it dies. `killed_by_player` holds when a player killed it. |
| [Crops](../blocks/crops.md) | Their block's `loot_table`, with `block_state` on `age` for grown or not. `harvest` is a table for picking. |
| Fishing | The fishing rod's `loot_table`, `bworld:gameplay/fishing`, rolled when it's reeled in. See [Fishing](#fishing). |
| Scripts | `ctx.loot.roll` and `ctx.loot.fill`, for anything else, like chests in structures. |
| What | How |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Blocks](../blocks/index.md) | `"loot_table"` in the block's json, rolled when it breaks, with its states and the tool. `"drops"` is the shorthand for one of an item. |
| [Mobs](../entities/index.md) | `"loot_table"` in the entity's json, rolled when it dies. `killed_by_player` holds when a player killed it. |
| [Crops](../blocks/crops.md) | Their block's `loot_table`, with `block_state` on `age` for grown or not. `harvest` is a table for picking. |
| Fishing | The `loot_table` of the `bworld:fishable` block the hook is in, `bworld:gameplay/fishing` for water, rolled when it's reeled in. See [Fishing](#fishing). |
| Scripts | `ctx.loot.roll` and `ctx.loot.fill`, for anything else, like chests in structures. |
`check-mods` checks that every item, tag and table a table names exists, and that the tables blocks and mobs name do.
## Fishing
The fishing table, `bworld:gameplay/fishing`, isn't a file: the base game builds it from every item with the
`bworld:fish` component, so a mod adds a fish by giving its item the component:
The fishing tables aren't files: the base game builds them from every item with the `bworld:fish` component, so a mod
adds a fish by giving its item the component. A fish lives in one liquid, water unless its `liquid` says otherwise, and
is in that liquid's table: the `loot_table` of its `bworld:fishable` component, `bworld:gameplay/fishing` when it
doesn't name one. Water's is `bworld:gameplay/fishing` and lava's is `bworld:gameplay/lava_fishing`:
```json
"components": {
@@ -151,6 +153,7 @@ The fishing table, `bworld:gameplay/fishing`, isn't a file: the base game builds
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `weight` | How often it's caught against the other fish, 1 when not given. |
| `seasons` | The [seasons](../worldgen/biomes.md#seasons) it's caught in where the hook is, every one when not given. |
| `liquid` | The `bworld:fishable` block it's caught in, `bworld:water` when not given, like `"bworld:lava"`. |
| `biomes` | The [biomes](../worldgen/biomes.md#biome-ids) and [biome tags](../worldgen/biomes.md#biome-tags) it's caught in where the hook is, every one when not given. |
| `time` | The hours it's caught at on a 24 hour clock, from `from` up to `to`, like `6.5` for 06:30. When `from` is past `to` it wraps around midnight. All day when not given. |
| `minigame` | What the player does to land it once it's reeled in, in a screen that holds the fish until they win. Closing it lets the fish get away. Caught right away when not given. The base game's are `"test"`, a Catch button, `"hold"`, a bar that fills while the mouse is held and empties while it isn't: full lands the fish, empty loses it, `"valley"`, Stardew Valley's, where holding the mouse lifts a bar to keep the fish in it, `"ring"`, where a green ring grows out toward gray ones and clicking while it's inside each lands the fish, `"maze"`, where the mouse goes from the start to the end of a maze without touching its walls, in 8 seconds, and `"chess"`, a mate in one from Lichess's puzzles to find in 8 seconds. |