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