Don’t Starve Together Commands

Don’t Starve Together Commands

To start the command console, the default keybinding is ` or ~. Commands use the Lua programming languages. This is just a simple list of common commands I use. Pressing the Ctrl key will switch between Remote and Local command mode. Typically you would want to be in Remote mode. When pasting commands using Ctrl-V, you may inadvertently switch modes.

Targetting Yourself

-- Use this

-- This is deprecated

List all players

for i, v in ipairs(AllPlayers) do TheNet:SystemMessage(tostring(i) .. ": " .., false) end

Execute command on all players

for k,v in pairs(AllPlayers) do INSERTCOMMANDHERE end

Resurrect everybody

for k,v in pairs(AllPlayers) do AllPlayers[k]:PushEvent('respawnfromghost') end

Heal all players on server.

for k,v in pairs(AllPlayers) do AllPlayers[k] end

Give an item to player by name

for k,v in pairs(AllPlayers) do if == "playernamehere" then v.components.inventory:GiveItem(DebugSpawn("honey")) end end

Examples to get properties/methods from ThePlayer object

for key,value in pairs(ThePlayer) do print("ThePlayer " .. key, value) end

for key,value in pairs(getmetatable(ThePlayer)) do print("getmetatable(ThePlayer) " .. key, value) end

for key,value in pairs(ThePlayer.components) do print("ThePlayer.components - " .. key, value) end

for key,value in pairs( do print(" - " .. key, value) end

for key,value in pairs(getmetatable( do print("getmetatable( - " .. key,value) end

The values will be printed to console as well as %UserProfile%\Documents\Klei\DoNotStarveTogether\client_log.txt by default.

Remove a nearby object


Domesticate a nearby beefalo

c_find("beefalo").components.domesticatable.domestication=1; c_find("beefalo").components.domesticatable:BecomeDomesticated();

Change the tendancy of a nearby beefalo

Possible values are “DEFAULT”, “ORNERY”, “RIDER”, “PUDGY”

c_find("beefalo").components.hunger:DoDelta(400); c_find("beefalo").components.domesticatable:DeltaTendency("RIDER",100); c_find("beefalo"):SetTendency()

Game Files

The has lua files that can be examined to understand the data structure and methods better: C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\databundles\


Leave a Reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.