Administration and TShock
How you administer a Terraria server depends on its mode:
- Vanilla (and tModLoader): there is no in-game admin role. You manage the server from the panel Console.
- TShock: you create an owner account in game, then manage groups and permissions for your players and moderation team.
Console commands (vanilla)
In the Game Panel (game.yorkhost.fr), open your server's Console and type commands without /:
| Command | Effect |
|---|---|
help | List of available commands |
playing | List of connected players |
say <message> | Sends a message to all players |
kick <player> | Kicks a player |
ban <player> | Bans a player (added to the banlist file) |
save | Saves the world |
exit | Saves the world and stops the server |
password / password <pass> | Shows / changes the password (current session) |
motd / motd <message> | Shows / changes the message of the day (current session) |
time | Shows the in-game time |
dawn, noon, dusk, midnight | Sets the time to dawn, noon, dusk or midnight |
settle | Settles the world's water |
version | Server version |
Bans are stored in the file set by banlist in serverconfig.txt (often banlist.txt). To unban someone, stop the server, remove the player's lines from that file in the Files tab, then restart.
Type save before a risky operation if you are not using the panel's stop button.
TShock: becoming owner with /setup
TShock replaces the vanilla server with an enhanced version: player accounts, groups, permissions, region protection, moderation tools and plugins. It still works with regular Terraria clients.
TShock only works with vanilla Terraria. On a tModLoader server, TShock commands and plugins are not available. To switch modes, see Getting started.
The setup code
On the first start of a TShock server, a setup code is shown in the panel Console. It is also saved to a file in the tshock/ folder (usually setup-code.txt).
- Start the server and note the code shown in the console
- Join the server in game
- In the game chat, type:
/setup 123456
replacing 123456 with your code.
- Create your owner account (pick a strong password):
/user add MyName MyPassword owner
- Log in with that account:
/login MyName MyPassword
- Type
/setupone last time (without a code) to disable the setup system
You now have full rights on the server. Log in again with /login each time you join.
Until the setup system is disabled, anyone who knows the code can take control of the server. Complete the steps above before opening the server to the public.
Player accounts
Players create their account in game, then log in:
/register Password
/login Password
Depending on your configuration, TShock can require players to be logged in to play (RequireLogin setting in tshock/config.json), which is recommended for a public server.
Groups and permissions
Each account belongs to a group, and each group has a list of permissions. TShock ships with default groups, from least to most privileged: guest (not logged in), default (registered player), vip, newadmin, admin, trustedadmin and owner. A group can inherit the permissions of a parent group.
| Command | Effect |
|---|---|
/group list | List of groups |
/group listperm <group> | A group's permissions |
/group add <group> | Creates a group |
/group parent <group> <parent> | Makes a group inherit from another |
/group addperm <group> <permission> | Adds a permission |
/group delperm <group> <permission> | Removes a permission |
/group prefix <group> <prefix> | Prefix shown before the name in chat |
/user group <account> <group> | Puts an account in a group |
Example: create a moderator group based on default that can kick and ban:
/group add moderator
/group parent moderator default
/group addperm moderator tshock.admin.kick tshock.admin.ban
/user group ModName moderator
A few common permissions: tshock.admin.kick, tshock.admin.ban, tshock.tp.self (teleport), tshock.item.spawn (/item command), tshock.admin.region (region management). Exact names may vary between TShock versions: check with /group listperm admin or in the official TShock documentation.
To quickly promote a trusted member, just put their account in an existing group, for example /user group ModName admin, rather than building a group from scratch.
Useful TShock commands
| Command | Effect |
|---|---|
/help | Commands available to your group |
/who | Connected players |
/kick <player> [reason] | Kicks a player |
/ban add <player> [reason] [duration] | Bans a player (see /ban help for your version's syntax) |
/ban list / /ban del <number> | Lists / removes a ban |
/mute <player> | Mutes a player |
/tp <player> | Teleports to a player |
/time <time> | Sets the in-game time (for example /time noon) |
/item <item> [amount] | Gives yourself an item |
/save | Saves the world |
/off | Saves and stops the server |
TShock commands also work from the panel Console: try them with the /, and without it if your version does not recognise it.
Protecting an area (regions)
To protect the spawn or a base against changes:
/region set 1, then hit the block at the top-left corner of the area/region set 2, then hit the block at the bottom-right corner/region define AreaName- Allow a player to build inside:
/region allow PlayerName AreaName
/region list and /region info AreaName show existing regions.
TShock configuration
TShock's files are in the server's tshock/ folder:
| File | Role |
|---|---|
config.json | TShock settings: name, password, slots, mandatory login, spawn protection… |
sscconfig.json | Server-Side Characters: inventories stored on the server |
tshock.sqlite | Database: accounts, groups, permissions, bans, regions |
Some config.json settings (password, number of slots) take precedence over serverconfig.txt. Do not change the port in this file: the server must stay on the port assigned by the panel.
To edit config.json, stop the server, edit it in the Files tab while keeping valid JSON syntax (quotes, commas), then restart. The /reload command reloads part of the settings without a restart.
tshock/tshock.sqlite holds all your accounts, groups and regions. Include it in your backups, alongside the world: see Importing a world and backups.
Installing TShock plugins
- Download the plugin (
.dllfile) from a trusted source, in a version compatible with your TShock version - Stop the server
- Drop the
.dllinto theServerPlugins/folder using the Files tab or SFTP - Start the server and check in the console that the plugin loads without errors
A plugin written for an older TShock version can prevent the server from starting: remove it if that happens (see Troubleshooting).