Most Valheim cheats, such as spawn, fly, god, and heal, only run on the machine hosting the world. On a dedicated server that is the server, not you, so these commands reply “not valid in the current context” until you install the Server_devcommands BepInEx plugin. Kick, ban, and the other native admin commands need no mod; see Valheim Admin Commands for those.
Set Up Server_devcommands
You need both of these. Installing the plugin on the server alone does not work, which is the step most people miss.
- Get on the admin list. Add your Valheim player ID (the
V_prefixed ID from the in-gameF2player list) to the server’sadminlist.txt. See How to Become an Admin, or open a ticket and we’ll add you. - Install Server_devcommands on your own computer. Despite the name, it runs on your game client:
- In a mod manager such as r2modman or Gale, create a Valheim profile.
- Install Server_devcommands (by JereKuusela) and accept the BepInExPack Valheim dependency.
- Start the game from the mod manager, not from Steam, or the plugin will not load.
- Join your server and press
F5. The plugin enables the console for you, so you don’t need-console. It also turns devcommands on automatically when you join as an admin. If it doesn’t, typedevcommands; the console replies “Dev commands: True”. Run it again to turn it off.
Install it on the server too for event commands. The client install covers the player cheats below. The event commands (event, randomevent, stopevent) and resetwind also need Server_devcommands on the server, which needs BepInEx on the server. If you didn’t select BepInEx at checkout, or want us to install it, open a ticket through Discord or the Client Area.
Devcommands Reference
| Command | What it does |
|---|---|
spawn <item> [amount] [level] | Spawn an item, creature, or prefab. Example: spawn SwordIron 1 4 |
god | Toggle invincibility. With Server_devcommands it also removes stamina use |
fly | Toggle flight (Space to go up, Ctrl to go down) |
heal | Restore your health, stamina, and eitr to full |
tame | Tame all nearby tameable creatures |
killall | Kill nearby creatures, including your tamed ones. Does not affect players |
puke | Clear your food |
goto <x> <z> | Teleport to coordinates |
resetcharacter | Reset your character data, including skills |
raiseskill <skill> <amount> | Raise a skill by a number of levels. Use All for every skill, or a negative amount to lower it |
spawn uses Valheim’s internal prefab IDs, not display names: iron sword is SwordIron, not “Iron Sword”. See the Valheim wiki item code list.
pos (print your coordinates) and freefly (detached photo camera) are not cheats and work without devcommands.
World and Event Commands
| Command | What it does |
|---|---|
sleep | Skip to the next morning |
skiptime [seconds] | Advance world time by the given number of seconds (240 if left out) |
resetkeys | Wipe global keys (boss-defeat flags and other progression markers). Useful for “un-defeating” bosses to change raid escalation |
event <name> | Force-start a named world event (for example, a specific raid). Needs the plugin on the server |
randomevent | Trigger a random world event. Needs the plugin on the server |
stopevent | Cancel the currently running event. Needs the plugin on the server |
resetwind | Reset the wind to normal after changing it with wind. Needs the plugin on the server |
sleep, skiptime, and resetkeys run on the server. On a vanilla server an admin can run them after devcommands without the plugin, but the console shows no reply, and devcommands is one switch shared by every admin, so another admin running devcommands turns it off again. Server_devcommands shows you the result and avoids that.
To change world modifiers, use setworldmodifier, a native admin command that needs no devcommands. See Valheim Admin Commands.
Singleplayer or a Listen Server
No mod is needed when you play singleplayer or host the world from your own game. Enable the F5 console, press F5, and type devcommands.
Troubleshooting
Commands say “not valid in the current context”
- Server_devcommands is not active on your client. Check it is installed in your profile and that you started the game from the mod manager.
- Your ID is not on the admin list, or does not match. Use the
V_prefixed ID from theF2list, copied exactly (it is case sensitive). - For
event,randomevent,stopevent, andresetwind, the plugin also has to be installed on the server.
The console says “You are not admin”
Your ID is not on the server’s admin list. See How to Become an Admin.
F5 does nothing
Without the plugin, turn on the console in Settings > Gameplay, or add -console to the launch options you actually start the game with. With the plugin, check that you started the game from the mod manager.
Still stuck? Contact our support team.
Frequently Asked Questions
Not without a mod. Player cheats such as spawn, god, fly, and heal only run on the machine hosting the world, so a player connected to a dedicated server gets 'not valid in the current context'. Install the Server_devcommands mod on your own game client and add your player ID to the server admin list to use them. The native admin commands (kick, ban, unban, banned, save, setworldmodifier, setworldpreset) work with no mod and are listed in the Admin Commands guide.
They need devcommands, but not strictly the mod. On a vanilla dedicated server an admin can run devcommands and then sleep or skiptime, and the server runs them. The console shows no reply, though, and devcommands is a single switch shared by all admins, so another admin running it turns it off again. Server_devcommands fixes both, which is why we recommend it.
Yes. Enable the console (Settings or the -console launch option), press F5 in-game, and run devcommands. That enables the full cheat set for the current session. This vanilla flow works in singleplayer or when you host the world from your own game, not on a dedicated server.






Valheim