Console Commands
The console is a text window in Valheim where you type commands. It has chat and server tools for every player, plus cheats such as god mode, flying, free building and spawning any item or creature by its ID. Every item, creature and build piece page here shows its spawn ID in the infobox and its tables, with a button that copies the whole spawn command.
How to Enable the Console
You have to switch the console on before you can open it, and how you do that depends on where you bought the game:
Steam
In your library, right-click Valheim, open Properties, and type -console in Launch Options on the General tab. Press F5 in game to open the console.
PC Game Pass
In the game folder, usually C:\XboxGames\Valheim\Content, make a shortcut to Valheim.exe. Open its Properties and add -console to the end of the Target field, then start the game from that shortcut and press F5.
Xbox
Hold LB, RB and Menu together in game, then press A to bring up the keyboard.
Mac (App Store)
Make a text file named valheim.sh containing /Applications/Valheim.app/Contents/MacOS/Valheim -console. Run it to start the game, then press F5.
GeForce Now
Turn on Steam family sharing, start Valheim through GeForce Now, enter the sharing PIN, add -console as on Steam and start the game. You have to do this again every session.
How to Use Console Commands
Press F5 to open the console, type a command and press Enter. help lists the available commands, and typing / then Tab in chat lists the player commands.
Cheat commands stay locked until you type devcommands and press Enter, and typing it again locks them. They work in single player and on a world you host yourself, but not on a dedicated server.
To spawn something, type spawn followed by its ID, an amount and a level. spawn Wood 50 drops fifty wood at your feet, and spawn Troll 1 3 spawns a two-star troll, since level 3 is two stars. Every spawn ID links here, and its copy button puts the whole command on your clipboard, ready to paste into the console.
Cheat Commands
These need devcommands first.
| Command | Effect | Note |
|---|---|---|
addstatus [name]
|
Adds a status effect. | For example: Rested, Burning, SoftDeath, Wet, etc. |
aggravate
|
Aggravates neutrals within 20 meters. | - |
beard [beard#]
|
Permanently changes your beard. | Entering this command without an argument removes your beard. |
clearstatus
|
Removes any status effects (good and bad). | - |
dpsdebug
|
Toggles dps debug print on and off. | - |
env [env]
|
Sets debug environment. | Variables: Clear, Twilight_Clear, Misty, Darklands_dark, Heath clear, DeepForest Mist, GDKing, Rain, LightRain, ThunderStorm, Eikthyr, GoblinKing, nofogts, SwampRain, Bonemass, Snow, Twilight_Snow, Twilight_SnowStorm, SnowStorm, Moder, Ashrain, Crypt, SunkenCrypt. |
exploremap
|
Reveals the entire map. | - |
event [name]
|
Starts the named event. | - |
ffsmooth 1
|
Adds smooth movements to free camera. | "ffsmooth 0" will reset smooth movements to normal. |
forcedelete [radius=5] [*name]
|
Removes objects within given radius (up to 50 meters). | If ID is given, only objects that contain the name on their ID. Following objects are never removed: Players and tombstones, Valkyrie, Points of Interests (locations), Dungeons and their rooms, Vegvisirs, Boss stones at the start temple. |
find [text] [pingmax]
|
Finds matching objects and pings them on the map. | Pingmax defaults to 1; If greater, will place pins on the map instead. |
findtp [text]
|
Finds matching objects and teleports the player to the nearest match. | - |
fly
|
Toggles the fly mode. | Same as in the debug mode, Press 'Z' with Debug on. |
freefly
|
Toggles the free camera. | - |
gc
|
Shows garbage collection information. | - |
genloc
|
Redistributes all unplaced locations. | - |
ghost
|
Toggles ghost mode (enemies ignore user if true). | - |
god
|
Enables god mode. (Makes user invicible if true). | Keeps users' health at '1' even if damage would exceed remaining health. |
goto [x] [z]
|
Teleports player to the specified coordinates. | - |
hair [hair#]
|
Permanently changes your hair. | Entering this command without an argument removes your hair. |
heal
|
Regenerates user to full health, stamina, and eitr. | - |
itemset [name] [keep]
|
Spawns a premade item set. | Without "keep" flag, current items will be dropped. Meadows: Skills set to 1. Wood/flint weapons with a Bronze Pickaxe. BlackForest: Skills set to 10. Wood/flint weapons. Swamps: Skills set to 10-20. Bronze weapons and armor. Mountains: Skills set to 25. Iron weapons and armor. Plains: Skills set to 35. Silver weapons and wolf armor. PlainsBoss: Skills set to 40. Blackmetal weapons and padded armor. Mistlands: Skills set to 70. Upgraded Blackmetal weapons, padded armor. MistlandsGear: Skills set to 70. Mistlands weapons and carapace armor. MistlandsMage: Skills set to 70. Eitr armor, all magical staffs (to Mistlands) and Eitr food. MistlandsWarrior. Skill set to 70. MIstlands weapons and carapace armor. Ashlands. Skills set to 30. All Ashlands weapons and flametal and embla armor. AshlandsMage. Skills set to 30. All magical staffs (to Ashlands), embla armor and Eitr food AshlandsWarrior. Skills set to 30. All Ashlands weapons and ammo, flametal armor and food. AshlandsFood. Skills set to 30. All Ashlands foods (x10). AshlandsWeapons. Skills set to 30. All Ashlands weapons in each variant. AshlandsMedium. Skills set to 30. All Ashlands weapons, Ask armor and food. Fisherman: Skills set to 40. Fishing rod, 50 of each bait, 5 of each Fish and Fenris armor. |
killall
|
Kills nearby enemies and tamed creatures. | Does not kill players. |
killenemies
|
Kills nearby enemies. | Same as in the debug mode, Press 'K' with Debug on. |
killtame
|
Kills nearby tamed creatures. | - |
listkeys
|
Lists all global keys. | - |
location [name]
|
Spawns a location instance. | Permanently disables saving. |
location [name] SAVE
|
Spawns a location instance. | Saving is not disabled. |
model [0-1]
|
Switches character model from masculine to feminine. | - |
nextseed
|
Forces the next dungeon to a seed (regenerates it). | Permanently disables saving. |
nocost
|
Toggles the no cost mode. | Same as in the debug mode, Press 'B' with Debug on. |
players [number]
|
Adjusts the difficulty scale. | Enter 0 to reset difficulty. |
pos
|
Shows player coordinates. | - |
printcreatures
|
Prints the counts and levels of active creatures. | - |
printlocations
|
Prints the loaded locations and their distances and offsets to the player. | - |
puke
|
Resets fullness/hunger, returning you to default Health/Stamina. | - |
raiseskill [skill] [amount]
|
Raises (or lowers) the named skill by the value entered. | If 'All' is entered in place of [skill], all skills will increase by the value entered. To lower a skill, type "-" before the value. |
randomevent
|
Starts a random event. | - |
recall [name]
|
Teleports all players matching the name to your position. | Without name, teleports all players. |
removebirds
|
Removes all active birds. | - |
removedrops
|
Removes all items drops in the area. | Same as in the debug mode, Press 'L' with Debug on. |
removefish
|
Removes all active fish. | - |
removekey [name]
|
Removes a global key. | - |
resetcharacter
|
Resets all of your character data. | - |
resetenv
|
Resets the debug environment. | - |
resetkeys [name]
|
Removes all Global Keys. | [name] parameter does not do anything. |
resetmap
|
Hides entire map. | - |
resetskill [skill]
|
Sets specified skill level to 0. | If 'All' is entered in place of [skill], all skills will be reset to level 0. |
resetwind
|
Resets the wind angle and intensity. | - |
save
|
Forces the game to save the current world state. | - |
setfuel [value]
|
Adds value amount of fuel to all nearby fire sources | Default is 10, does not overfill. Negative values will reduce the level of fuel in fire sources down to zero. |
setkey [name]
|
Adds a global key. | - |
setpower [name]
|
Sets the current Forsaken power and resets the cooldown | For example: GP_Eikthyr, GP_TheElder, etc. |
skiptime [seconds = 240]
|
Skips forward, changing day number and time of day. | This does not update timestamps of objects which causes issues when going back in the time. Spawn zones stop spawning enemies until the time is back to the original. Animals and plants stop growing until the time is back to the original. Fermenters, Smelters and Kilns may stop working until the time is back to the original (but this can be easily fixed by destroying them). |
sleep
|
Skips forward one day. | - |
sortcraft
|
Sorts crafting list by Name, Type, Weight, Count or Original. | Name sorts by alphabetical order Type sorts by the type of the item, then alphabetical, in this order: Material, Food (-Feasts), One-handed Melee/Thrown Weapon, (Cross)Bow, Shield, Helmet, Chest Armor, Arrow/Bolt, Leg Armor, Two-handed Melee Weapon + Scythe, Light source, Misc., Cape/Cloak, Utility, Tool, "TwoHandedWeaponLeft", Ballista Ammo Weight sorts by lightest to heaviest, then alphabetical. (No consideration of total per craft, i.e. Boar Jerky, or total possible) Count sorts by deep magics unknown Original sorts by default or otherwise "resets" the sorting order |
spawn [entity name] [amount] [level]
|
Spawns specified entity. | Every item, creature and build piece page on this wiki shows its spawn ID. If the entity name ends with a star (*), the command spawns each entity that contains the entity name. All item drops will be spawned one by one. Spawning thousands of items can make the game freeze before the item drops get autostacked. High level creatures (level 10+) can make the game freeze on death by dropping thousands of items. Some spawnable entites can not be removed from the game without using mods. |
stopevent
|
Stops the current event. | - |
tame
|
Tames all nearby tameable Creatures. | - |
test [value]
|
Toggles a test value. | "oldcomfort" Reverts to old non-optimized comfort calculation. |
time
|
Shows the current time and whether sleeping is possible. | - |
timescale [target = 1] [fadetime = 0]
|
Sets the speed of time. | Up to 5x speed. Fadetime sets the transition duration. Value 0 pauses the game. Freefly works while paused. Pausing the game in singleplayer by pressing ESC removes time scaling. |
tod [0-1]
|
Sets time of day. | 0 and 1 are both midnight. 0.5 is noon. -1 revert to default. |
wind [angle] [intensity]
|
Adjusts the direction and intensity of the wind. | "angle" = degree vector from 0 to 360 (0 is wind from south, 270 is wind from east). "intensity" = value from 0 to 1.0. For example: "wind 90 0.5" gives a moderate strength wind blowing from west to east. |
Debug Mode
With devcommands on, debugmode turns debug mode on, and typing it again turns it off. It adds these keys:
| Key | Action |
|---|---|
| B | Toggle for creative mode building, no workbench or resources needed. |
| K | Kills nearby enemies (excluding tamed creatures). |
| L | Removes nearby item drops. |
| Z | Toggle to fly. Spacebar gives you altitude, Ctrl brings you back down. |
| Ctrl + MMB (on map) | Teleport to cursor location. |
| Shift + C | Set time to day. |
Player Commands
These work without devcommands and can also be typed into the chat window.
| Command | Effect | Note |
|---|---|---|
bind [keycode] [command]
|
Binds a custom command to a Unity keycode. | E.g. bind mouse4 cheer will cause the player to perform the cheer emote upon pressing mouse4. Can bind multiple commands, including devcommands.
|
clear
|
Clears the console window. | - |
cr
|
Unloads unused assets | Happens by default every 20 minutes, but this commands forces a fresh unload. |
die
|
kill yourself | - |
exclusivefullscreen
|
changes window mode to exclusive fullscreen, or back to borderless | - |
filtercraft [name]
|
filters crafting list to contain part of text | - |
fov [number]
|
Changes field of view. | - |
hidebetatext
|
Toggles beta text visibility. | - |
help [page] [pages = 5]
|
Shows the available commands. | Optional parameters allow showing only some part of the commands. For example, "help 2 4" shows the second quarter. |
info
|
Prints the current system information | - |
lodbias [number]
|
Sets the draw distance for the server. | The number can be set from 1 to 7. |
maxfps [FPS]
|
sets fps limit | - |
nomap
|
Toggles map visibility. | If the server, also toggles the nomap global key. |
noportals
|
Toggles portals. | If the server, toggles the noportals global key. |
optterrain
|
Converts all the old terrain modifications in the nearby area to the new system. | - |
ping
|
Pings the server to measure latency. | - |
printbinds
|
Prints current custom command binds. | - |
printseeds
|
Prints seeds and positions of nearby dungeons. | - |
resetbinds
|
Removes all custom commands binds. | - |
resetknownitems
|
reset character known items & recipes | - |
resetplayerprefs
|
Resets any saved settings and variables (not the save game) | - |
resetsharedmap
|
Removes shared map data from cartography table. | - |
resetspawn
|
Resets the spawn location. | - |
resetworldkeys [name]
|
Resets all world modifiers to default | - |
respawn
|
Kills the character. | - |
restartparty
|
Restarts the playfab party network. | - |
s
|
Shouts a chat message. | - |
say
|
Says a chat message. | - |
setworldmodifier [name] [value]
|
Sets a world modifier value | - |
setworldpreset [name]
|
Resets all world modifiers to a named preset | - |
sortcraft [type]
|
sorts crafting lists according to setting | - |
tutorialreset
|
Resets viewed tutorial messages. | - |
tutorialtoggle
|
Toggles whether the tutorials are shown. | - |
unbind [keycode]
|
Clears all custom command binds from a Unity keycode. | - |
W [player name]
|
Whispers a chat message to a player. | - |
xb:version
|
Prints mercurial hashset used for this build | - |
Admin Commands
These only work for a player whose SteamID64 or crossplay ID is on the server's admin list.
| Command | Effect | Note |
|---|---|---|
ban [name/ip/userID]
|
Bans the named user. | - |
banned
|
Shows a full list of banned users. | - |
kick [name/ip/userID]
|
Kicks the named user. | - |
resetworldkeys
|
Resets all world modifiers to default. | This does not reset gameplay progression keys. |
save
|
Forces the game to save. | - |
setworldmodifier [name] [value]
|
Sets a world modifier slider value | - |
setworldpreset [name]
|
Resets all world modifiers to a named preset. | - |
unban [name/ip/userID]
|
Unbans the named user. | - |
All Categories