thumbnail
Return to Blog Catalog
Dont Starve Together

Don't Starve Together: All Console Commands & How to Use Them

Posted on by justin
(Estimated Read Time: 19 minutes)
Are you tired of grinding for a specific item in Don't Starve Together? Perhaps you need to travel to another location in The Constant quickly. If time is of the essence, you can complete various goals using console commands in Don't Starve Together and skip pesky mechanics or even fix a bug yourself!

Don't Starve Together Console Commands

Don't Starve Together Console Commands
Don’t Starve Together console commands are active by default. Press the tilde key (~) to open the in-game command console. It’s also important to mention that some commands may not work in an online multiplayer setting unless you’re the server administrator.
Also, access the settings.ini file in your system's "DoNotStarveTogether" folder (without the quotes) if you can't access the command console. Here, look for the console_enabled field and change its setting to “true” (without the quotes) if it’s currently set to “false.”
Remember, exit the game before saving the settings.ini file, or the changes may not take effect. Additionally, don't change other fields unless you know their effects. Otherwise, the game might misbehave, which may require a clean reinstall to fix.

General Commands

Spawn prefab
  • Command syntax: c_spawn("prefab",amount)
  • Description: Spawns a “prefab” (e.g., mobs, items, blueprints, etc.) under the mouse cursor.
Give Item
  • Command syntax: c_give("prefab",amount)
  • Description: Spawns the “prefab” in the player’s inventory and its set amount. Only works with items that can spawn in the backpack.
Go Adventuring
  • Command syntax: c_goadventuring()
  • Description: Gives a set of starting items to the player.
Scenario
  • Command syntax: c_doscenario(scenario)
  • Description: Applies a scenario to a selected element and runs it.
Set Your Health
  • Command syntax: c_sethealth(percent)
  • Description: Sets the player’s current Health to the defined percentage in decimal format.
Set Your Sanity
  • Command syntax: c_setsanity(percent)
  • Description: Sets the player’s current Sanity to the defined percentage in decimal format.
Set Your Hunger
  • Command syntax: c_sethunger(percent)
  • Description: Sets the player’s current Hunger to the defined percentage in decimal format.
Set Your Moisture
  • Command syntax: c_setmoisture(percent)
  • Description: Sets the player’s current Wetness to the defined percentage in decimal format.
Temperature
  • Command syntax: c_settemperature(degrees)
  • Description: Sets the player’s current Wetness to the defined percentage in decimal format.
God Mode
  • Command syntax: c_godmode()
  • Description: Immune to Sanity, Hunger, and Health drain when attacked. The player can’t change stats while godmode is active. This command also revives the player immediately upon death. Use the command again to deactivate it.
Super God Mode
  • Command syntax: c_supergodmode()
  • Description: Enables godmode and permanently fills all stats to their maximum levels.
Maintain Your Health
  • Command syntax: c_maintainhealth(ThePlayer)
  • Description: Enables supergodmode but also regenerates Health constantly. Use command “c_cancelmaintasks(ThePlayer)” (without the quotes) to deactivate it.
Maintain Your Sanity
  • Command syntax: c_maintainsanity(ThePlayer)
  • Description: Enables supergodmode but also regenerates Sanity constantly. Use command “c_cancelmaintasks(ThePlayer)” (without the quotes) to deactivate it.
Maintain Your Hunger
  • Command syntax: c_maintainhunger(ThePlayer)
  • Description: Enables supergodmode but also regenerates Sanity constantly. Use command “c_cancelmaintasks(ThePlayer)” (without the quotes) to deactivate it.
Maintain Your Temperature
  • Command syntax: c_maintaintemperature(ThePlayer)
  • Description: Enables supergodmode but also regenerates Temperature constantly. Use command “c_cancelmaintasks(ThePlayer)” (without the quotes) to deactivate it.
Maintain Your Moisture
  • Command syntax: c_maintainmoisture(ThePlayer)
  • Description: Enables supergodmode but also regenerates Moisture constantly. Use command “c_cancelmaintasks(ThePlayer)” (without the quotes) to deactivate it.
Maintain All
  • Command syntax: c_maintainall(ThePlayer)
  • Description: Enables supergodmode but also regenerates all stats constantly. Use command “c_cancelmaintasks(ThePlayer)” (without the quotes) to deactivate it.
Mob Invisibility
  • Command syntax: c_makeinvisible()
  • Description: It turns the player invisible to hostile mobs, but it may not work every time.
Set Your Running Speed
  • Command syntax: c_speedmult(multiplier)
  • Description: Sets the player’s running speed. The default multiplier is 1. Setting it to 2 makes the player run twice as fast. Setting the multiplier at a higher number will increase the running speed further up to a maximum of 12.

Player Commands

Action Prediction
  • Command syntax: ThePlayer:EnableMovementPrediction(enable)
  • Description: Enabled by default. Disabling this command exchanges rubberbanding for choppiness, which may help in some combat scenarios.
Creative Mode
  • Command syntax: c_freecrafting()
  • Description: Craft everything freely. Input the command again to deactivate.
Give All Recipes
  • Command syntax: GetPlayer().components.builder:GiveAllRecipes()
  • Description: Gives all crafting recipes to the player.
Maximum Health
  • Command syntax: ThePlayer.components.health:SetMaxHealth(value)
  • Description: Changes the Maximum Health of the player to the defined value.
Maximum Sanity
  • Command syntax: ThePlayer.components.sanity:SetMax(value)
  • Description: Changes the Maximum Sanity of the player to the defined value.
Maximum Hunger
  • Command syntax: ThePlayer.components.hunger:SetMax(value)
  • Description: Changes the Maximum Hunger of the player to the defined value.
Pause Hunger
  • Command syntax: ThePlayer.components.hunger:Pause(true)
  • Description: The player won’t starve.
Change the Damage Multiplier
  • Command syntax: ThePlayer.components.combat.damagemultiplier=(value)
  • Description: Changes the player’s damage multiplier to the defined value.
Werebeaver Transformations
  • Command syntax: c_setbeaverness(percentage)
  • Description: Set to 1 to turn Woodie into the Werebeaver. Revert Woodie to normal by setting the value to 0.
List Players in the Server
  • Command syntax: c_listallplayers()
  • Description: Prints all players for viewing. It may not work sometimes.
Get A Certain Player
  • Command syntax: AllPlayers[number]
  • Description: First, use c_listallplayers() to know each player’s assigned number. Then, use that value in this command to get that player.
Apply A Command To All Players
  • Command syntax: for k,v in pairs(AllPlayers) do command end
  • Description: Replace the “command” word with another command. For example, move players to the mouse position with the command, “for k,v in pairs (AllPlayers) do c_move(v) end.”
Teleport Another Player To You
  • Command syntax: c_move(AllPlayers[number])
  • Description: Moves the player to the mouse position.
Kill A Player
  • Command syntax: AllPlayers[number]:PushEvent('death')
  • Description: Kills the defined player.
Resurrect A Player
  • Command syntax: AllPlayers[number]:PushEvent('respawnfromghost')
  • Description: Resurrects the defined player.
Give Creative Mode Status To A Player
  • Command syntax: AllPlayers[number].components.builder:GiveAllRecipes()
  • Description: Gives Creative Mode to the defined player.
Teleport To A Player
  • Command syntax: c_goto(AllPlayers[number])
  • Description: Teleports the user to the defined player’s position.
Drop A Player's Inventory Items
  • Command syntax: AllPlayers[number].components.inventory:DropEverything()
  • Description: Drops every item in the defined player’s inventory.
Despawn A Player's Character
  • Command syntax: c_despawn(AllPlayers[number])
  • Description: Forces another player’s character to return to the character selection screen for repicking. Warning: This command deletes that player’s entire inventory.

Global Commands

Teleport to Prefab
  • Command syntax: c_gonext("prefab")
  • Description: Teleports the player to the nearest instance of the defined prefab.
Delete Item Under Mouse
  • Command syntax: ConsoleWorldEntityUnderMouse():Remove() OR c_select():Remove()
  • Description: Deletes the element under the mouse cursor. Use the second command on dedicated Don’t Starve Together servers.
Delete All
  • Command syntax: for k,v in pairs(Ents) do if v.prefab == "prefab" then v:Remove() end end
  • Description: Deletes every instance of the defined prefab globally.
Reveal Map - Self
  • Command syntax: minimap = TheSim:FindFirstEntityWithTag("mini­map")
  • TheWorld.minimap.MiniMap:ShowArea (0,0,0,10000)
  • for x=-1600,1600,35 do
  • for y=-1600,1600,35 do
  • ThePlayer.player_classified.MapExplorer:RevealArea(x,0,y)
  • end
  • end
  • Description: A local-only command that reveals the map to the player.
Reveal Map - All Players
  • Command syntax: for k,v in pairs(AllPlayers) do for x=-1600,1600,35 do for y=-1600,1600,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end
  • Description: A remote-only command that reveals the map to all players.
Skip Time Units And Update
  • Command syntax: LongUpdate(X)
  • Description: Skips X time units. Then, performs the “LongUpdate” function on world objects.
Speed Up Simulation
  • Command syntax: c_speedup()
  • Description: Speeds up time in the current world. Some events may trigger because of the sped up time.
Set Simulation Time
  • Command syntax: TheSim:SetTimeScale(X)
  • Description: Set the time of the simulation to a specific value. Setting the X to 0 will pause the game, but it also disables the console command, preventing the game from resuming.
Skip Time
  • Command syntax: TheWorld.net.components.clock:OnUpdate(16*30*x)
  • Description: Skips the number of days indicated in “x.” Warning: Indicating a large value may freeze the game.
Skip Day
  • Command syntax: c_skip(num)
  • Description: Skips the number of indicated days.
Skip to the Next Day Cycle
  • Command syntax: TheWorld:PushEvent("ms_nextcycle")
  • Description: Skips to the next day in the current world cycle.
Skip Phase
  • Command syntax: TheWorld:PushEvent("ms_nextphase")
  • Description: Skips the current Day Cycle phase.
Set Phase
  • Command syntax: TheWorld:PushEvent("ms_setphase",PHASE NAME)
  • Description: Changes to specific Day Cycle phase. Phase names can be "day," "dusk," or "night."
Set Segments
  • Command syntax: TheWorld:PushEvent("ms_setclocksegs", {day=x,dusk=y,night=z})
  • Description: Sets amount of segments. Errors if x + y + z adds up to over 16. Note that this will get reset the next day. For example, input “TheWorld:PushEvent("ms_setclocksegs", {day=14,dusk=1,night=1})” (without the quotes) to create a very long day, very short dusk, and night (one segment for dusk and one for night).
Skip to the Next Nightmare Cycle
  • Command syntax: TheWorld:PushEvent("ms_nextnightmarecycle")
  • Description: Skips to the next Nightmare Cycle.
Skip Nightmare Phase
  • Command syntax: TheWorld:PushEvent("ms_nextnightmarephase")
  • Description: Skips to the current Nightmare Cycle phase.
Set Nightmare Phase
  • Command syntax: TheWorld:PushEvent("ms_setnightmarephase",PHASE NAME)
  • Description: Changes to specific Nightmare Cycle phase. Phase names can be "calm," "warn," "wild,” or "dawn."
Set Nightmare Segments
  • Command syntax: TheWorld:PushEvent("ms_setnightmaresegs", {calm=A,warn=B,wild=C,dawn=D})
  • Description: Sets amount of nightmare segments. A, B, C, and D can be any number. This function will not get reset at the next cycle. For example, input “TheWorld:PushEvent("ms_setnightmaresegs", {calm=20,warn=1,wild=1,dawn=1})” (without the quotes) to create a very long calm phase, and a very short warn, wild, and dawn phase (The default setting is {calm=12,warn=3,wild=5,dawn=2}).
Lock Nightmare Phase
  • Command syntax: TheWorld:PushEvent("ms_locknightmarephase",PHASE NAME)
  • Description: Lock at specific Nightmare Cycle phase. Phase names can be "calm," "warn,” "wild," or "dawn."
Stop Locking Nightmare Phase
  • Command syntax: TheWorld:PushEvent("ms_locknightmarephase")
  • Description: Disables the Lock Nightmare Phase function.
Set Season Segments
  • Command syntax: TheWorld:PushEvent("ms_setseasonclocksegs", {summer={day=sx,dusk=sy,night=sz}, winter={day=wx,dusk=wy,night=wz}})
  • Description: Sets amount of segments. Errors if x + y + z adds up to over 16. Unlike setclocksegs, this is permanent.
Set Season Lengths
  • Command syntax: TheWorld:PushEvent("ms_setseasonlength", {season="summer", length=15})
  • Description: Sets the lengths of the seasons.
Start Season
  • Command syntax: TheWorld:PushEvent("ms_setseason", "{season}")
  • Description: Change {season} to “winter,” “spring,” “summer,” or “autumn” (without the quotes) to start that season.
Start Rain
  • Command syntax: TheWorld:PushEvent("ms_forceprecipitation")
  • Description: Triggers rain.
Stop Rain
  • Command syntax: TheWorld:PushEvent("ms_forceprecipitation", false)
  • Description: Stops rain. This also includes Frog Rain.
Do Lightning Strike
  • Command syntax: TheWorld:PushEvent("ms_sendlightningstrike", ConsoleWorldPosition())
  • Description: Fires a lightning strike on the position of the mouse cursor. It’ll hit a lightning rod instead if it’s nearby.
Meteor Strike
  • Command syntax: c_spawn("shadowmeteor", 1)
  • Description: Calls a meteor strike on the position of the mouse cursor. Warning: This function may crash the game.
Activate All Events
  • Command syntax: 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
  • Description: Activate all in-game events at the same time. It won’t work if the events section in world generation is set to Auto.
Measure Distance
  • Command syntax: print(math.sqrt(ThePlayer:GetDistanceSqToInst(ConsoleWorldEntityUnderMouse())))
  • Description: Prints the distance between the player and the object under the mouse to the console log (displayed with Ctrl + L by default).

Network/Server Commands

Kick/Ban A Player
  • Command syntax: TheNet:Kick(userid) OR TheNet:Ban(userid)
  • Description: Kicks or bans the specified user from the server.
Temporarily Ban A Player
  • Command syntax: TheNet:BanForTime(userid,time_in_seconds)
  • Description: Ban a specified player from the server for a set period.
Connect To A Server
  • Command syntax: c_connect("IP address", port, "password")
  • Description: Connect to a server with the indicated IP address, port, and password. Useful if a user is running into problems when connecting to a specific server.
Reload The World
  • Command syntax: c_reset()
  • Description: Reloads the world without saving. This command may crash the game if you are a client.
Regenerate The World
  • Command syntax: c_regenerateworld()
  • Description: Regenerates the items in a world.
Regenerate A World Shard
  • Command syntax: c_regenerateshard()
  • Description: Regenerates the items in a shard.
Save The Server
  • Command syntax: c_save()
  • Description: Forces autosave to trigger.
Shut Down The Server
  • Command syntax: c_shutdown( true / false)
  • Description: Indicating “true” will save the game, and “false” will exit without saving.
Roll Back The Server
  • Command syntax: c_rollback(count)
  • Description: Rolls back a server by the specified number of saves.
Enable/Disable New Player Joining
  • Command syntax: TheNet:SetAllowIncomingConnections( true / false )
  • Description: Setting it to “true” is the default behavior, meaning people can join. Setting it to false prevents anyone from joining.
Make A Server Announcement (For Dedicated Server Console)
  • Command syntax: c_announce("announcement")
  • Description: This function allows administrators to announce server shutdowns/restarts so players do not just get disconnected without warning.
Stop a Vote
  • Command syntax: c_stopvote()
  • Description: Stops the current voting process.

Skill Tree Commands

Give Character Max Inpiration Points
  • Command syntax: TheSkillTree:AddSkillXP(10000, "{character name}")
  • Description: Gives one character the maximum number of Inspiration points possible.
Give The Current Character The Status For Killing Ancient Fuelweaver
  • Command syntax: TheGenericKV:SetKV("fuelweaver_killed", "1")
  • Description: Gives one character the status of killing the Ancient Fuelweaver, which can be useful if you want to unlock a skill locked behind this prerequisite.
Give The Current Character The Status For Killing Celestial Champion
  • Command syntax: TheGenericKV:SetKV("celestialchampion_killed", "1")
  • Description: Gives one character the status of killing the Celestial Champion, which can be useful if you want to unlock a skill locked behind this prerequisite.

Miscellaneous Commands

Change Something's Length, Width, And Height
  • Command syntax: c_select().Transform:SetScale(x, y, z)
  • Description: Changes a mob or player’s dimensions. This function only affects what the user sees. Other players won’t see the effect.
Clear The Morgue
  • Command syntax: ErasePersistentString("morgue")
  • Description: Clears the morgue. Requires closing and reopening the game for changes to be seen.
Count The Number Of Something In The Entire World, And Return The Value To Your Character
  • Command syntax: ThePlayer.components.talker:Say(tostring(c_countprefabs("prefab")))
  • Description: This remote-only command returns the total number of something in the entire world and returns the value as though the character is talking.
Count The Number Of Something In The World
  • Command syntax: c_countprefabs("prefab")
  • Description: When sending the command using local, it returns the number of prefabs in your active area only. When sending the command using remote, it returns the number of prefabs in the world; the result prints on the server console for a dedicated server.
Spawn Wormhole Or Cave Entrance/Exit
  • Command syntax: worm1 = c_spawn("wormhole") THEN worm2 = c_spawn("wormhole")
  • Description: Spawns a Wormhole or Cave Entrance at the position of the mouse cursor.
Create Connections Back And Forth
  • Command syntax: worm1.components.teleporter.targetTeleporter = worm2 AND worm2.components.teleporter.targetTeleporter = worm1
  • Description: Connects a Wormhole’s entrance and exit.
Spawn a Domesticated Beefalo
  • Command syntax: function spawn_beef(tendency) local beef = c_spawn("beefalo"); beef.components.hunger:DoDelta(400); beef.components.domesticatable:DeltaTendency(tendency, 1); beef:SetTendency(); beef.components.domesticatable.domestication = 1; beef.components.domesticatable:BecomeDomesticated(); end
  • Description: Spawns a tamed Beefalo nearby.
Teleport Items To The Player
  • Command syntax: c_find("item").Transform:SetPosition(AllPlayers[1]:GetPosition():Get())
  • Description: This command will teleport the nearest item to the player.
Alter Player Size
  • Command syntax: ThePlayer.Transform:SetScale(number,number,number)
  • Description: Alter the size of the player.
Alter Size of Prefab Under Mouse
  • Command syntax: c_select().Transform:SetScale(number,number,number)
  • Description: Alter the size of the prefab under the mouse cursor.
Alter Player Color/Transparency
  • Command syntax: c_select().Transform:SetScale(number,number,number)
  • Description: Changes the player’s color and/or transparency.
Alter Color/Transparency of Prefab Under Mouse
  • Command syntax: ThePlayer.AnimState:SetMultColour(number,number,number,number)
  • Description: Changes the color and/or transparency of the prefab under the mouse cursor.
Makes Prefab Under Mouse Pick-Up-Able
  • Command syntax: c_select():AddComponent("inventoryitem")
  • Description: Makes prefab under mouse pick-up-able. Warning: This command does usually crash the game if mods are enabled.
Change A Character's Body, Face, Hand, And Other
  • Command syntax: for k,v in pairs(Ents) do if v.AnimState and v.AnimState:GetBuild() == "character'sname" then v.AnimState:OverrideSymbol("bodypart", "enothercharacter'sname","bodypart") end end
  • Description: Where "character'sname," write the name of the character whose body part you want to change. For instance: "webber," "wilson," or "wx78."
Fully Unlock the Scrapbook
  • Command syntax: TheScrapbookPartitions:DebugUnlockEverything()
  • Description: Unlocks all scrapbook entries.
Use these console commands in a Don’t Starve Together dedicated server today! Click on the link below to start one in a few easy steps. Otherwise, chat with our support specialists for concerns and queries.
Get Started with a
Dont Starve Together Server

Looking to create your own gaming server? It only takes a few minutes.

Search our blog

Join our Discord!

20,000+ Members & Growing!

Join our DiscordDISCORD
Share our blog

Start your Dont Starve Together server

Looking to create your own gaming server? It only takes a few minutes.

What do you think?

0 Responses
It's okayIt's Okay
It's okayPerfect
It's okayLoved it!