Single module modding
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user