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
@@ -8,12 +8,12 @@ Each argument type reads its part of the text and suggests what could go there.
## Registering a Command
In the server script's `setup`:
In the server phase:
```ts
import type { Player, ServerContext } from "cubi/server";
export function setup(ctx: ServerContext) {
export function server(ctx: ServerContext) {
const { literal, argument, types } = ctx.commands;
const heal = (player: Player, amount: number) => player.heal(amount);
@@ -102,7 +102,7 @@ ctx.commands.register("hello", {
Command names are `a-z`, `0-9` and `_`. Two mods registering the same name, or a mod registering one of the engine's,
stops the server from starting. Every mod command can also be run as `/<mod id>:<name>`, like `/copper_tools:heal`.
Commands can only be registered during `setup`.
Commands can only be registered while the server phase runs.
## The Engine's Commands