Don't Starve

Don't Starve

Not enough ratings
Guide for Cheats/Console Commands (Singleplayer)
By swag yums
This is a basic guide to console commands in the singleplayer version of Don't Starve.
   
Award
Favorite
Favorited
Unfavorite
Introduction
This is a basic guide to Don't Starve console commands, using exclusively ones that I find would be the most useful for messing around during gameplay.

A full list of the console commands for the singleplayer game can be found on the Don't Starve wiki: https://dontstarve.fandom.com/wiki/Console/Commands

Enabling Console Commands
The console should be enabled by default. Pressing the "~" key will open the console and pause the game. Pressing CTRL + L will close the console.

In order to use console commands, you first need to input this command:

RunS​cript("consolecommands")
Basic Commands
These are basic commands for spawning items or tweaking various player-related effects.

Spawn Anything:

c_spawn("prefab", amount)

This command will spawn any entity under the player's cursor. Where the command specifies prefab, it refers to the pre-fabricated identity of the entity within the game's code. This is different from the name of the entity that the player can see.

A full list of prefabs can be found on this page on the wiki: https://dontstarve.fandom.com/wiki/Console/Prefab_List

Where the command specifies "amount", the player will put the number of entities they want to spawn at the cursor. The player doesn't need to specify an amount if they only want to spawn one of something.

The command c_spawn("beefalo") will spawn one beefalo at the position the player's cursor is on screen.

Spawn Any Item:

c_give("prefab", amount)

This command is similar to the previous one, however it deposits the spawned item in the player's inventory. Only works with items or other things that can be stored in the inventory.

Unlock All Recipes, Godmode

c_godmode()
c_supergodmode()


Disables Sanity, Hunger, and Health drain. I'm not sure what the difference between "godmode" and "supergodmode" is, I only knew of the former before I checked the wiki. There are certain cases that will disable godmode, and require it to be enabled again such as:

  • Entering/exiting a wormhole.
  • Entering/exiting a cave.
  • Changing worlds (such as with the Seaworthy)
  • "Using complicated commands too many times." (the wiki specifies this, but I'm not sure what it means)

Unlock All Recipes:

c_freecrafting()
GetPlayer().components.builder:GiveAllRecipes()


This command unlocks all recipes, and allows all items to be crafted anywhere, for free.
Character Commands
These commands modify values relating to the player character. For commands to unlock characters, see the "Profile Commands" section.

Setting Running Speed:

c_speed(value)

The player's normal speed value is 1. Numbers over 40 will cause players to walk through walls and over water.

Set Maximum Health:

​​GetPlayer().components.health:SetMaxHealth(value)

Changes a character's maximum health.

Set Maximum Hunger

​GetPlayer().components.hunger:SetMax(value)

Changes a character's maximum hunger.

​Set Maximum Sanity:

​GetPlayer().components.sanity:SetMax(value)

Changes a character's maximum sanity.

Pause Hunger:

​GetPlayer().components.hunger:Pause(true)

Stops the player's hunger from draining.
World-based Commands
These commands relate to modifying things about the world, like skipping days, setting the current season, changing the weather, etc.

Basic World Commands:

Teleport to Specified prefab:

​c_gonext("prefab")​
c_warp("prefab")


These commands will teleport you to the first numerical instance of the specified prefab. Inputting the command again will teleport you to the next instance in the numerical list. The first instance would be registered as the first of that prefab generated in the world.

Delete Entity:

​TheInput:GetWorldEntityUnderMouse():Remove()

Deletes the entity under the player's mouse.

Remove All of Specified prefab:

c_removeall("prefab")

Removes every instance of the specified prefab.

Reveal Map:

c_revealmap()
GetWorld().minimap.MiniMap:ShowArea(0,0,0,10000)


Reveals the entire map. The map will be re-hidden upon quitting and reloading the world, but any explored areas will remain explored.

Modifying the World:

These commands relate to changing the date, time, season, or weather.

Skip Day:

​GetClock():MakeNextDay()

Skips to the next day.

Skip Specified Number of Days:

​c_skipdays(x)

Skips "x" number of days. Putting the number 3 between the parentheses will skip 3 days. Might cause lag or crashes with large numbers.

Reset Clock:

GetClock():Reset()

Resets the day counter back to 1.

Set Length of Day, Dusk, Night:

The day clock is divided into 16 segments. This command allows you to modify the amount of segments that each time gets. Breaks if the total number of segments adds up to be greater than 16.

​GetClock():SetSegs(day,dusk,night)

The command ​GetClock():SetSegs(14,1,1) will set the time to be a very long day, and a very short dusk and night.

Skip Day Phase:

​GetClock():NextPhase()

Skips to the next phase of the day. Using this command while the day timer is in the yellow will change the time to dusk.

Change Season:

​GetSeasonManager():Start[season]()

Starts the season specified in the brackets. This command is case sensitive, and the name of the season will need have its first letter be capitalized. Also works with DLC seasons.

  • ​GetSeasonManager():StartSummer() -- Starts Summer. If the Reign of Giants DLC is not enabled, it will start what would normally be Autumn if Reign of Giants were enabled.
  • ​GetSeasonManager():StartWinter() -- Starts Winter
  • GetSeasonManager():StartAutumn() -- Starts Autumn
  • GetSeasonManager():StartSpring() -- Starts Spring
  • SHIPWRECKED COMMANDS
  • GetSeasonManager():StartMild() -- Starts Mild Season
  • GetSeasonManager():StartWet() -- Starts Hurricane Season
  • GetSeasonManager():StartGreen() -- Starts Monsoon Season
  • GetSeasonManager():StartDry() -- Starts Dry Season
  • HAMLET COMMANDS
  • GetSeasonManager():StartTemperate() -- Starts Temperate Season
  • GetSeasonManager():StartHumid() -- Starts Humid Season
  • GetSeasonManager():StartLush() -- Starts Lush Season

Start/Stop Rain:

​GetSeasonManager():StartPrecip()

Starts rain, changes according to the season (it will snow in winter).

​GetSeasonManager():StopPrecip()

Stops rain.

Create Lightning:

​GetSeasonManager():DoLightningStrike(Vector3(GetPlayer().Transform:GetWorldPosition()))

Strikes the player with lightning, or a lightning rod if there is one nearby.

Save the Game:

c_save()

Saves the game.

Rollback to Previous Save

c_reset()

Rollback/Resets to the last save made.

Regenerate Cave:

c_regeneratecave()

Regenerates a cave layout. Hover the cursor over the cave entrance to reset it.
Profile Commands
These commands are permanent and only need to be done once, and are usually related to unlocking characters.

Change Character:

c_swapcharacter(prefab)

Swaps your character to be that of the character specified in the prefab. (for Maxwell the prefab would be waxwell).

A save and quit is required for the change to take effect.

Unlock Character:

Profile:UnlockCharacter("prefab")
Profile:Save()


Unlocks the character in specified by the prefab.

Unlock All Characters:

Profile:UnlockEverything()

Unlocks all characters.

Clear Morgue:

​ErasePersistentString("morgue")

Clears the morgue, a log of all of the player's deaths over the course of their playtime.

Re-lock Character:

Profile.persistdata.unlocked_characters["prefab"] = false
Profile:Save()


Will lock any character specified in the prefab, except Wilson. Changing false to true will unlock the character.

Re-lock All Characters:

ErasePersistentString("profile")

Re-locks all characters, except Wilson. The game needs to be closed and re-opened for the changes to be seen.

Unlock Warbucks:

RETIRED_CHARACTERLIST = {}

This command empties the retired character list, which currently only holds a removed character, Warbucks, within it. Warbucks is a character from an older version of Hamlet, but if you want to play him, you can enable his selection on the menu screen by inputting this command. Closing the game will require you to input the command again.

Edit Retired Character List:

RETIRED_CHARACTERLIST = {"prefab", "prefab"}

Edits the retired character list with the specified prefab. Makes any character hidden on the selection screen, if you want to do that for some reason.
Conclusion
Make sure you put RunS​cript("consolecommands") into the console first to enable console commands.
2 Comments
a meme lover 2 Jan, 2024 @ 1:12pm 
The Run script command doesn't work >:(
Popsicle 5 Aug, 2023 @ 2:08pm 
thanks for this guide:steamthumbsup: