Don’t Starve Together (DST) Console Commands

Don’t Starve Together (DST) Console Commands

To start the command console, the default keybinding is ` or ~. Commands use the Lua programming language. 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
ThePlayer

-- This is deprecated
GetPlayer()

List all players

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

Execute command on all players

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

Execute a c_ command on all players

for k,v in pairs(AllPlayers) do c_select(AllPlayers[k]); c_speedmult(3.0) end; c_select(ThePlayer)

Make sure you select yourself again afterwards to run other c_ commands. (This is what the c_select(ThePlayer) tries to do.

Resurrect and Restore all Stats

for k,v in pairs(AllPlayers) do AllPlayers[k]:PushEvent('respawnfromghost') AllPlayers[k].components.health:SetPercent(1) AllPlayers[k].components.hunger:SetPercent(1) 
AllPlayers[k].components.sanity:SetPercent(1) end

Resurrect everybody

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

Heal all players on the server.

for k,v in pairs(AllPlayers) do AllPlayers[k].components.health:SetPercent(1) end

Give an item to a player by name

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

Multiplier for Damage Dealt

ThePlayer.components.combat.damagemultiplier=5
for k,v in pairs(AllPlayers) do v.components.combat.damagemultiplier=5 end

Teleport to a player

 c_goto(AllPlayers[2])

Teleport a player to you

c_move(AllPlayers[2])

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.health) do print("ThePlayer.components.health - " .. key, value) end
for key,value in pairs(getmetatable(ThePlayer.components.health)) do print("getmetatable(ThePlayer.components.health) - " .. key,value) end

print commands will print to the server_log.txt file under %UserProfile%\Documents\Klei\DoNotStarveTogether\<PLAYERID>\Cluster_<NUMBER>\Master\server_log.txt

Remove/destroy a specific nearby object

c_find('pond'):Remove()

Domesticate a nearby beefalo

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

Change the tendency 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()

Fun Mode

for k,v in pairs(AllPlayers) do AllPlayers[k]:PushEvent('respawnfromghost') AllPlayers[k].components.health:SetPercent(1) AllPlayers[k].components.hunger:SetPercent(1) 
AllPlayers[k].components.sanity:SetPercent(1) end for k,v in pairs(AllPlayers) do c_select(AllPlayers[k]); c_speedmult(3.0) end c_select(ThePlayer) for k,v in pairs(AllPlayers) do v.components.combat.damagemultiplier=100 end

Game Files

The scripts.zip 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\scripts.zip

References

https://dontstarve.fandom.com/wiki/Console/Don%27t_Starve_Together_Commands

https://www.bisecthosting.com/blog/dont-starve-together-console-commands-cheats

Leave a Reply

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


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