Don't Starve Together Admin Console Commands Reference
Complete admin console command reference for Don't Starve Together — c_save, c_rollback, c_spawn, c_give, c_shutdown, kick, ban, and more.
Once you're an admin on a Don't Starve Together server, the in-game console (~) gives you a Lua REPL with access to the entire game state. This page is the complete reference for the day-to-day admin commands you actually need: rolling back grief, force-saving, spawning items, kicking, banning, and shutting down cleanly.
Prerequisites
Before any of this works:
- Your Klei ID (
KU_xxxxxxxx) must be inCluster_1/adminlist.txt— see Adding Admins cluster.inimust haveconsole_enabled = trueunder[MISC]- You must be connected to the server in-game
Opening the Console
Press the tilde key (~) to open the console. Type a command and press Enter.
By default commands run client-side only. To run a command on the server (which is what most admin actions need), press Ctrl+Enter instead — or toggle the "Remote" mode by clicking the icon at the top of the console.
Save & Rollback
The most-used commands. These are how you protect against grief.
| Command | Description |
|---|---|
c_save() | Force a save right now |
c_rollback() | Roll back to the most recent save |
c_rollback(N) | Roll back N snapshots (default max is 6) |
c_reset() | Reload the world from the last save (no rollback) |
Workflow: before something risky (boss fight, mod test, big build), run c_save(). If it goes wrong, c_rollback(1).
Server Lifecycle
| Command | Description |
|---|---|
c_shutdown() | Save and shut the server down |
c_shutdown(true) | Same — saves before exiting |
c_shutdown(false) | Shut down without saving (use only if save is corrupted) |
c_announce("message") | Broadcast a message to all players |
c_regenerateworld() | Wipes the current world and generates a new one. No undo. |
c_regenerateshard() | Regenerate just the current shard (Master or Caves) |
Spawning Items & Creatures
| Command | Description |
|---|---|
c_spawn("prefab") | Spawn a single entity at your cursor |
c_spawn("prefab", N) | Spawn N entities |
c_give("prefab") | Give yourself one item |
c_give("prefab", N) | Give yourself N items |
c_give("prefab", N, AllPlayers[1]) | Give the item to a specific player by index |
Examples:
c_give("log", 40)
c_give("twigs", 40)
c_give("rocks", 20)
c_spawn("deerclops")
c_spawn("pigman", 5)The full prefab name list is on the DST wiki.
Player Management
| Command | Description |
|---|---|
TheNet:GetClientTable() | List every connected client (returns a Lua table) |
TheNet:Kick("KU_xxx") | Kick a player by Klei ID |
TheNet:Ban("KU_xxx") | Permanently ban a player by Klei ID |
TheNet:GetUserID() | Print your own Klei ID (run as a player to see your ID) |
c_listplayers() | Print the player list to the console (shorter alias) |
c_kick(N) | Kick the player at index N in the player list |
c_ban(N) | Ban the player at index N |
c_kick(1) is faster than TheNet:Kick("KU_...") when you just want to boot the most-recently-joined player.
Time & Weather
| Command | Description |
|---|---|
LongUpdate(N) | Skip N seconds of game time forward |
LongUpdate(480) | Skip one in-game day |
TheWorld:PushEvent("ms_setseason", "winter") | Force change the season |
TheWorld:PushEvent("ms_forceprecipitation", true) | Start rain |
TheWorld:PushEvent("ms_setphase", "night") | Force night |
c_godmode() | Toggle godmode on yourself |
Health, Sanity, Hunger
| Command | Description |
|---|---|
ThePlayer.components.health:SetPercent(1) | Heal yourself to full |
ThePlayer.components.sanity:SetPercent(1) | Restore sanity to full |
ThePlayer.components.hunger:SetPercent(1) | Fill hunger |
c_godmode() | All three at once + invincibility |
c_supergodmode() | Godmode + free crafting + revive on death |
Useful One-Liners
-- Give every connected player 20 logs
for i,v in ipairs(AllPlayers) do v.components.inventory:GiveItem(SpawnPrefab("log"), 20) end
-- Set everyone's HP to full
for i,v in ipairs(AllPlayers) do v.components.health:SetPercent(1) end
-- Find your Klei ID
print(TheNet:GetUserID())
-- Print the player list
for i,v in ipairs(AllPlayers) do print(i, v.name, v.userid) endCommon Issues
| Problem | Cause | Fix |
|---|---|---|
| "You don't have admin privileges" | Not in adminlist.txt, or didn't restart after adding | Add yourself, restart |
| Commands have no effect | Running client-side, not server-side | Press Ctrl+Enter instead of Enter, or toggle Remote mode |
c_rollback(N) rolls back fewer days than expected | DST keeps a max of 6 snapshots by default | Increase max_snapshots in cluster.ini [GAMEPLAY] |
c_spawn("prefab") spawns nothing | Wrong prefab name (case-sensitive) | Check the DST wiki |
c_regenerateworld() regenerated everything you wanted to keep | There is no undo. | Always back up before running this. See Backup & Restore |
Related Guides
How is this guide?

How To Add Admins to Your Don't Starve Together Server
Learn how to grant admin permissions on your Don't Starve Together dedicated server.
How to Ban and Whitelist Players on Your Don't Starve Together Server
Use blocklist.txt and whitelist.txt to permanently ban grief players or reserve slots for trusted players on your DST dedicated server.