Single module modding
This commit is contained in:
@@ -38,7 +38,7 @@ The base game's tiers:
|
||||
| `2` | iron | 7 | everything so far |
|
||||
|
||||
Tool types don't have to be the base game's. A mod can add a `"sickle"` type and blocks with `"tool": "sickle"`, and a
|
||||
server script can check a held item's type with `ctx.items.tool(id)`, like the base game's `bworld:hoeable` does for
|
||||
server phase can check a held item's type with `ctx.items.tool(id)`, like the base game's `bworld:hoeable` does for
|
||||
hoes. The base game's watering cans are tools of type `"watering_can"` that no block is mined with: they come in the
|
||||
same five tiers with the same durability, and each holds more water than the last (16, 24, 32, 48 and 64), set by its
|
||||
`bworld:watering_can` component.
|
||||
@@ -52,5 +52,5 @@ dropping.
|
||||
The damage a tool has taken is kept in its stack's `data.damage`, and a worn tool shows a bar under it in its slot,
|
||||
going from green to red as it wears down. Upgrading a tool at the smithing table keeps its data, damage included.
|
||||
|
||||
A server script wears a tool down with `ctx.items.damage(item, amount)`, which adds to the stack's `data.damage` and
|
||||
The server phase wears a tool down with `ctx.items.damage(item, amount)`, which adds to the stack's `data.damage` and
|
||||
returns true when that used it up. It does nothing to items that aren't tools. The base game's death drops use it.
|
||||
|
||||
Reference in New Issue
Block a user