bcd42f50e9
A test script drives a server mod as a server would: join = "Alex" brings a player in (ids stable per name, so a rejoin is the same player), as = "Steve" picks who acts (the first player on otherwise), and player, chat, command, break and place are that player's doing; leave = "Alex" lets them go. Server expectations: told (every players.tell, "Name: text") and broadcast; feedback and error read the reply to the player who typed the command. Ticks call both kinds of tick hooks, so one script format serves client and server mods. The welcome example gets two scripts (greeting, a newcomer announced once even after a reload, /online across dimensions, /mined per player), run by the sandbox tests with coords-hud's; docs/mods.md lists the server keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
694 B
TOML
32 lines
694 B
TOML
# /online lists the players and their dimension; /mined counts the acting player's blocks.
|
|
|
|
[[step]]
|
|
join = "Alex"
|
|
expect.commands = ["online", "mined"]
|
|
|
|
[[step]]
|
|
join = "Steve"
|
|
as = "Steve"
|
|
player = { dimension = "minecraft:the_nether" }
|
|
command = "online"
|
|
expect.feedback = "Alex (overworld), Steve (the_nether)"
|
|
|
|
[[step]]
|
|
as = "Alex"
|
|
break = { x = 1, y = 63, z = 0, state = "minecraft:stone" }
|
|
|
|
[[step]]
|
|
as = "Alex"
|
|
break = { x = 2, y = 63, z = 0, state = "minecraft:dirt" }
|
|
|
|
# A step's command comes before its break and place.
|
|
[[step]]
|
|
as = "Alex"
|
|
command = "mined"
|
|
expect.feedback = "You broke 2 block(s)"
|
|
|
|
[[step]]
|
|
as = "Steve"
|
|
command = "mined"
|
|
expect.feedback = "You broke 0 block(s)"
|