Admin Commands for Don't Starve Together


Summary 
Don't Starve Together has many commands for administrators and solo playthroughs, such as spawning items, kicking players, and more. Players can open the console with the tilde key and type their chosen command, with the option to autofill by pressing tab. This allows admins to quickly cycle through commands in-game, which can help deal with immediate issues on the server.

Requirement
Admin Privileges are required to use commands on servers. Learn how to grant admin access here.


Admin Commands for Don't Starve Together

1. Launch Don't Starve Together and connect to the server.


2. Open the console with the tilde (~) key.


3. Press Ctrl to enter Local mode, which helps view command outputs in-game.


Server Commands

Function Description Syntax
Kick Player Kicks a player out of the server. TheNet:Kick(userid)
Ban Player Kicks and prevents access to the server. TheNet:Ban(userid)
Regenerate World Shard Regenerates specified items in a shard. c_regenerateshard()
Enable/Disable Player Joining Allows players to join when set to true . TheNet:SetAllowIncomingConnections( true / false )
Server Announcement Announces server shutdowns/restarts. c_announce("announcement")

Common Commands

Function Description Syntax
Spawn Prefab Spawns designated prefab under the cursor. c_spawn("prefab",amount)
Give Item Spawns premade parts in inventory. c_give("prefab",amount)
Go Adventuring Gives a set of starting items. c_goadventuring()
Scenario Applies a scenario script. c_doscenario(scenario)
Set Health Sets health to a selected percentage. (0.9 = 90%) c_sethea​lth(percent)
Set Sanity Sets sanity to a selected percentage. (0.9 = 90%) c_setsanit​y(percent)
Set Hunger Sets hunger to a selected percentage. (0.9 = 90%) c_sethunger(pe​rcent)
Set Moisture Sets moisture to a selected percentage. (0.9 = 90%) c_setmoisture(pe​rcent)
Set Temperature Sets temperature to a selected percentage. (0.9 = 90%) c_settemperature(degrees)
God Mode No longer depletes health, sanity, or hunger. Will resurrect upon death. c_godmode()
Super God Mode Like god mode, but sets stats to maximum even after disabling. c_supergodmode()
Maintain Health Constantly regenerates health. c_maintainhealth(ThePlayer)
Maintain Sanity Constantly regenerates sanity. c_maintainsanity(ThePlayer)
Maintain Hunger Constantly regenerates hunger. c_maintainhunger(ThePlayer)
Maintain Temperature Constantly regenerates temperature. c_maintaintemperature(ThePlayer)
Maintain Moisture Constantly regenerates moisture. c_maintainmoisture(ThePlayer)
Maintain All Constantly regenerates all stats. c_maintainall(ThePlayer)
Mob Invisibility Prevents mobs from attacking the player, excluding boss fights. c_makeinvisible()
Set Running Speed Sets the player's running speed. c_speedmult(multiplier)

Player Commands

Function Description Syntax
Hide/Show HUD Hide or show the full game HUD. GetPlayer().HUD:Hide()GetPlayer().HUD:Show()
Creative Mode Craft everything for free. GetPlayer().components.builder:GiveAllRecipes()
Maximum Health Sets the player's max health. GetPlayer().components.health:SetMaxHealth(value)
Maximum Sanity Sets the player's max sanity. GetPlayer().components.sanity:SetMax(value)
Maximum Hunger Sets the player's max hunger. GetPlayer().components.hunger:SetMax(value)
Pause Hunger Pauses the player's hunger. GetPlayer().components.hunger:Pause(true)
List All Players Lists all players by username and number. c_listallplayers()
Get Specific Player Displays info about the player with the specified number. AllPlayers[number]
Kill Player Kills the specified player. AllPlayers[number]:PushEvent('death')
Resurrect Player Revives a player. AllPlayers[number]:PushEvent('respawnfromghost')
Give Creative Mode Gives a specified player creative mode. AllPlayers[number].components.builder:GiveAllRecipes(
Teleport to Player Teleports to the specified player. c_goto(AllPlayers[number])
Werebeaver Turns Woodie into the Werebeaver. GetPlayer().components.beaverness:SetPercent(1)

World Commands

Function Description Syntax
Teleport to Prefab Teleports the player to the first numerical instance of the prefab name. c_gonext("prefab")
Delete Item Under Cursor Deletes the item under the mouse cursor. ConsoleWorldEntityUnderMouse():Remove()c_select():Remove()
Delete All Deletes items in the designated prefab. for k,v in pairs(Ents) do if v.prefab == "prefab" then v:Remove() end end
Skip Day Cycle Skips to the next day cycle. ​TheWorld:PushEvent("ms_nextcycle")
Skip Day Skips day time. c_skip(num)
Skip Time Skips time forward by the designated amount. TheWorld.net.components.clock:OnUpdate(16*30*x)
Skip Time Unit & Update Skips x time units and updates. LongUpdate(X)
Speed Up Simulation Speeds up the simulation of the world. c_speedup()
Skip Phase Skips the current world phase. TheWorld:PushEvent("ms_nextphase")
Set Segment Sets the duration for day, dusk, and night. (Total must not exceed 16) TheWorld:PushEvent("ms_setclocksegs", {day=x,dusk=y,night=z})
Set Season Segment Set duration for day, dusk, and night by season. (Total must not exceed 16) ​TheWorld:PushEvent("ms_setseasonclocksegs", {summer={day=sx,dusk=sy,night=sz}, winter={day=wx,dusk=wy,night=wz}})
Set Season Length Sets the number of days in a season. TheWorld:PushEvent("ms_setseasonlength", {season="summer", length=15})
Start Spring Sets the season to spring. TheWorld:PushEvent("ms_setseason", "spring")
Start Summer Sets the season to summer. TheWorld:PushEvent("ms_setseason", "summer")
Start Autumn Sets the season to autumn. TheWorld:PushEvent("ms_setseason", "autumn")
Start Winter Sets the season to winter. TheWorld:PushEvent("ms_setseason", "winter")
Start Rain Start raining. TheWorld:PushEvent("ms_forceprecipitation")
Lightning Strike Summon a lightning strike on the mouse cursor. TheWorld:PushEvent("ms_sendlightningstrike", ConsoleWorldPosition())
Meteor Strike Summon meteor strikes on the mouse cursor. (May cause the game to crash) c_spawn("shadowmeteor", 1)
Activate All Events Activate all events at the same time. for k, v in pairs(SPECIAL_EVENTS) do if v ~= SPECIAL_EVENTS.NONE then local tech = TECH[k] if tech ~= nil then tech.SCIENCE = 0 end end end function IsSpecialEventActive(event) return true end


Was this answer helpful?

0
« Back