Move curios into the main bworld mod

This commit is contained in:
2026-10-01 16:48:40 -03:00
parent 3dc7d2adee
commit a7835261e1
31 changed files with 170 additions and 159 deletions
+2 -1
View File
@@ -85,7 +85,8 @@ player.remove_modifier("bworld:attack_damage", "my_mod:rage");
The value is the base, plus every `add_value`, plus that times the amount of each `add_multiplied_base`, then times 1
plus the amount of each `add_multiplied_total`. A modifier with the same id replaces the old one. Modifiers aren't
saved: a mod that gives them should give them again when the player joins, the way Curios does for worn items.
saved: a mod that gives them should give them again when the player joins, the way the base game's curios slots do for
worn items.
Like Minecraft, an attack right after the last one, or right after changing the held item, does only a fifth of the
damage, rising to full after `20 / attack_speed` ticks. A bar under the crosshair shows it filling up, and the server
+3 -3
View File
@@ -7,8 +7,8 @@ Menus are how players use [containers](containers.md), like NeoForge's. A GUI ha
- The **screen** lives in the client script. It only draws the menu and sends the player's clicks.
Every click goes to the server, which applies it following the menu's rules, so a modified client can only do what the
menu allows. Chests, furnaces, the smithing table and Farmer's Delight's cooking pot are all menus, and Curios adds its
slots to [the player's inventory](#the-players-inventory).
menu allows. Chests, furnaces, the smithing table and Farmer's Delight's cooking pot are all menus, and the base game's
curios slots are part of [the player's inventory](#the-players-inventory).
## Registering a Menu Type
@@ -197,7 +197,7 @@ ctx.menus.extend_player_menu((menu, player) => {
`add_slot` takes the same options as a menu's. `x` and `y` are from the inventory screen's top left, and can be outside
it: a negative `x` is left of it. The engine draws a panel behind the slots outside its own, so they need no client
code. Curios puts its slots in 2 columns this way.
code. The base game puts its curios slots in 2 columns this way, in `mods/bworld/scripts/curios.ts`.
Shift clicking in the inventory puts a stack into the first of these slots whose `filter` takes it, before moving it
between the hotbar and the rest of the inventory. Shift clicking one of them moves its stack back into the inventory.
+1 -1
View File
@@ -97,7 +97,7 @@ At a block, the block's own [interaction](../blocks/components.md#interacting) c
used instead of being placed.
`ctx.items.components(id)` gives the components an item's JSON lists and their parameters, so a mod can read its
components' parameters for an item without a stack, like Curios does for `curios:attribute_modifiers`.
components' parameters for an item without a stack, like the base game's curios slots do for `bworld:curio_modifiers`.
`on_use` doesn't say which block was clicked. For that, pair it with a block component's `on_interact`, the way the
watering can uses `bworld:water_source`, or subscribe to the `block_interact` [event](../concepts/events.md).
-3
View File
@@ -77,6 +77,3 @@ ctx.net.send("copper_tools:reset_stats", {});
anything over that without telling anyone.
- Everything a client sends is untrusted: check it like a click or a chat message.
- A handler that throws is logged under its mod, and the other handlers still run.
Curios (`mods/curios`) is a small example: its client script's button sends `curios:open`, and its server script opens
the curio slots for that player.