Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Don’t Starve Together’s console is enabled by default. Press ~ on an English keyboard to open it, then enter Lua commands such as c_spawn("prefab", amount) to create objects or c_give("prefab", amount) to put inventory items directly in your character’s inventory. Host-only, server, and other-player commands require host status or dedicated-server administrator privileges and must be run in remote mode.

What the console can do

The in-game Lua console can create prefabs, grant materials, unlock recipes, alter player statistics, reveal information, and administer a running server. Its authority depends on where the command is sent:

Target Typical use Required authority Effect and persistence
Local player Recipes or personal statistics Usually the client; some commands still require host authority Normally affects the current session and may need to be repeated after loading a world
Entity or item Spawn a creature, structure, resource, or object Host or remote administrator for most world changes Changes the current world; the resulting world state can be saved
Inventory Give a carryable prefab to one player Host or remote administrator in multiplayer Changes that character’s inventory and can be saved with the world
World or server Save, shut down, roll back, announce, or control joining Host or dedicated-server administrator Can affect every connected player, a shard, or the entire cluster

Commands are entered in the console’s Lua prompt. Use the exact prefab name and quotation marks. A misspelled prefab generally produces no useful result or creates something other than what you intended. Test destructive operations in a disposable world or after making a backup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to open the DST console

Use the default key

  1. Launch Don’t Starve Together and enter a world.
  2. Press ~ (tilde/backtick on the standard English keyboard) to open the console.
  3. Type a command and submit it. Press the same key again to close the console.

The command reference says the console is enabled by default. If your keyboard layout does not produce ~, open the game’s Controls settings and assign a different console key.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Re-enable a disabled console on a client

If a local configuration has disabled the console, edit the client configuration while the game is closed. Add console_enabled = true under the [MISC] section.

  • Windows and macOS: DocumentsKleiDoNotStarveTogetherclient.ini
  • Linux: ~/.klei/DoNotStarve/client.ini

Save the file, start the game again, and test the key binding. Keep a copy of the original file so you can restore it if another setting is changed accidentally.

Local mode versus remote mode

When you are not the host, or when the world runs on a dedicated server, most commands must be sent remotely. With the console open, press Ctrl to toggle remote command mode. The console’s mode indicator should change before you submit a server, world, or other-player command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A dedicated-server administrator must also have the appropriate administrator privileges. If a command seems to do nothing, the most common causes are that the console is still in local mode or the account lacks host/admin authority. Map-reveal operations are noted as an exception that may remain local, but world, server, and player-management commands should be treated as remote unless the command reference says otherwise.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Spawn objects and give yourself materials

Create an object in the world with c_spawn

c_spawn("prefab", amount)

c_spawn creates the named prefab at the cursor or current placement location. The amount argument is optional when you need only one item. It is the general choice for entities and world objects, including things that cannot be stored in an inventory.

Use the exact internal prefab identifier rather than the item’s display name. For example, a name copied from a guide may be outdated or may refer to a modded prefab; verify the identifier in the version and mod set used by your world.

Put an inventory item in your character’s inventory with c_give

c_give("prefab", amount)

c_give is limited to inventory-compatible prefabs. It is convenient for materials, tools, food, and other carryable items because it bypasses placement in the world. If the object cannot be carried, use c_spawn instead.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Command Where the result appears Best use Important limitation
c_spawn("prefab", amount) In the world at the cursor/location Creatures, structures, plants, world objects, or non-carryable items Does not put the result directly into your inventory
c_give("prefab", amount) Your character’s inventory Carryable resources, equipment, consumables, and materials Cannot grant objects that are not inventory-compatible

Unlock recipes and change player statistics

Toggle free crafting

c_freecrafting()

Run c_freecrafting() once to give access to all recipes. Run the same command again to disable the effect. Treat it as a session cheat rather than a permanent account unlock; commands generally need to be entered again after loading a world.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Set maximum health, sanity, and hunger

ThePlayer.components.health:SetMaxHealth(value)
ThePlayer.components.sanity:SetMax(value)
ThePlayer.components.hunger:SetMax(value)

Replace value with the maximum you want for the current player. These commands alter the active character’s component values; they are not a substitute for normal healing, sanity restoration, or food mechanics. Keep a normal save before experimenting so you can restore the world if a value produces unexpected behavior.

Admin commands for a running server

Run the following from the host console or in remote mode as a dedicated-server administrator. In a shared world, tell players before using commands that alter saves, joining, movement, or another character.

Save and shut down

c_save()
c_shutdown(true)
c_shutdown(false)
  • c_save() saves immediately.
  • c_shutdown(true) saves and then shuts down.
  • c_shutdown(false) shuts down without saving.

c_shutdown() without an argument is documented as equivalent to c_shutdown(true), so it saves before exiting unless you explicitly pass false.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Roll back one or more saves

c_rollback()
c_rollback(3)

With no argument, the command rolls back one save. The number is measured in saves, not minutes or real-world time. Confirm the intended save point with everyone online before using it; progress made after that save can be lost.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Broadcast an announcement

c_announce("Server restarting soon")

The quoted text is sent as a server announcement to connected players. Use it to warn about a restart, rollback, maintenance, or a rule change before taking action.

Allow or block new connections

TheNet:SetAllowIncomingConnections(true)
TheNet:SetAllowIncomingConnections(false)

true permits new players to join; false blocks new incoming connections while the current session continues. This is useful during maintenance or while resolving a world problem.

List, move, or remove players

c_listallplayers()
c_move(AllPlayers[number])
c_despawn(AllPlayers[number])
  1. Run c_listallplayers() and note the index assigned to the intended player.
  2. Substitute that index for number in c_move or c_despawn.
  3. Submit the command remotely if the world is dedicated or you are not its host.

c_move(AllPlayers[number]) moves the selected player to the command executor’s location. c_despawn(AllPlayers[number]) removes the selected player from the world. Check the index carefully; using the wrong number targets a different connected player.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Dedicated-server console configuration

Understand the configuration split

Dedicated-server settings are divided between cluster-wide and shard-specific files:

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
File Scope Relevant console setting
cluster.ini Cluster-wide settings shared by the server configuration Under [MISC], set console_enabled = true
Master/server.ini Settings for the Master shard Shard-specific settings belong here
Caves/server.ini Settings for the Caves shard Shard-specific settings belong here

Make a backup before editing any file. After changing a shard’s configuration, restart the affected shard so the setting is read. A setting in the wrong file or section may be ignored without an obvious error.

Use the server’s account and setup tools carefully

Dedicated-server setup documentation has changed over time, and platform support can differ by release. Obtain the current server settings and platform requirements from the game’s official account and server documentation rather than relying on older setup instructions. Do not assume that a configuration example from an earlier release applies unchanged to every platform.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Persistence, rollback, and safety

  • Reloading a world: The command reference warns that most commands must be re-entered after loading a world. Keep a small, version-specific command list rather than assuming cheats remain active.
  • World destruction: Save before using reset or regeneration operations such as c_reset or c_regenerateworld. These can discard progress or replace world state.
  • Rollback: Save points are counted, so check how many saves you intend to reverse before running c_rollback(number).
  • Multiplayer consent: Spawning large numbers of entities, changing stats, moving players, or removing a player changes the shared session. Announce the action first when other people are connected.
  • Version and mods: Prefab names and command behavior can change with game updates or mods. A command copied from an older guide may fail even when its Lua syntax is correct.
  • Backups: Keep a separate copy of important world and cluster data before destructive administration.

Why a command does not work

The console will not open

  • Try the key assigned in Controls instead of assuming your keyboard produces the English-layout ~.
  • Check the appropriate client.ini path and confirm console_enabled = true is inside [MISC].
  • Close the game before editing the file, then restart it after saving the change.

The command runs but nothing changes

  • Check spelling, capitalization, quotation marks, and the prefab’s exact internal name.
  • For a dedicated server or a world hosted by someone else, press Ctrl with the console open and verify remote mode.
  • Confirm that the account executing the command is the host or a dedicated-server administrator.
  • Use c_give only for inventory-compatible items; use c_spawn for entities and non-carryable objects.
  • Re-enter commands after loading the world because most effects do not persist through a world load.

The wrong player is affected

  1. Run c_listallplayers() again rather than relying on an old index.
  2. Match the displayed index to the player’s name.
  3. Use the selected index in AllPlayers[number], and verify remote mode before submitting.

A server operation has unwanted consequences

Stop issuing commands, notify connected players, and restore the most recent known-good save or backup. Do not experiment with rollback, reset, or regeneration on the only copy of a world. If a shutdown was issued with false, the latest unsaved progress cannot be recovered through that command; a separate backup is the practical recovery path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A safe command workflow

  1. Identify the target: Decide whether you are changing your player, an inventory, an entity, a shard, or the entire server.
  2. Check authority: Be the host or use a dedicated-server administrator account for remote operations.
  3. Back up first: Save normally before rollback, reset, regeneration, or bulk spawning.
  4. Open the console: Press ~ or your custom Controls binding.
  5. Select remote mode when needed: Press Ctrl while the console is open.
  6. Run one command: Start with a small amount or a reversible change and confirm the result.
  7. Communicate in multiplayer: Announce changes that affect other players or the shared save.
  8. Record temporary changes: Note recipe and stat commands that must be repeated after a reload.

Used this way, the console is both a testing tool and a practical administration interface: c_spawn handles world objects, c_give handles carryable resources, the player-component commands adjust current statistics, and the server commands control saves, connections, announcements, and player management. Authority and remote mode are the deciding factors whenever a command affects more than the local client.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.