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>
22 lines
541 B
TOML
22 lines
541 B
TOML
# Joins are greeted; a newcomer is announced once, even after a reload (storage).
|
|
|
|
[[step]]
|
|
join = "Alex"
|
|
expect.told = ["Alex: Welcome, Alex! 0 other player(s) online."]
|
|
expect.broadcast = ["Alex is here for the first time"]
|
|
|
|
[[step]]
|
|
join = "Steve"
|
|
expect.told = ["Steve: Welcome, Steve! 1 other player(s) online."]
|
|
expect.broadcast = ["Steve is here for the first time"]
|
|
|
|
[[step]]
|
|
leave = "Alex"
|
|
expect.told = []
|
|
|
|
[[step]]
|
|
reload = true
|
|
join = "Alex"
|
|
expect.told = ["Alex: Welcome, Alex! 1 other player(s) online."]
|
|
expect.broadcast = []
|