Single module modding

This commit is contained in:
2026-11-14 12:18:41 -03:00
parent 605008f584
commit 313098892e
134 changed files with 919 additions and 924 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
A loot table says what something gives, as data: a block when it's broken, a mob when it dies, a fishing rod when it
reels something in, a crop when it's picked, and a container a script fills, like a chest in a ruin. They work like
Minecraft's, and mods can add their own conditions and functions from a server script.
Minecraft's, and mods can add their own conditions and functions from the server phase.
## Files and Ids
@@ -174,12 +174,12 @@ Those become the `bworld:season`, `bworld:biome` and `bworld:time` conditions, w
## From a Script
Server scripts roll tables, fill containers, and add conditions, functions and changes of their own:
The server phase rolls tables, fills containers, and adds conditions, functions and changes of its own:
```ts
import type { ServerContext } from "cubi/server";
export function setup(ctx: ServerContext) {
export function server(ctx: ServerContext) {
// "condition": "my_mod:night" in any table
ctx.loot.register_condition("my_mod:night", (_params, context) => ctx.world.time % 24000 > 13000);