spawn Console Command
What It Does
The "spawn" command in Valheim is primarily used to create or generate objects, creatures, or items within the game world. In other words, it lets you create something out of thin air. You can use the spawn command followed by the respective item or character ID and quantity you need. For example, if you need 10 bronze nails, you would use this command: spawn BronzeNails 10.
A note on character spawning: you can also specify a difficulty level (although it only affects spawned characters). The higher the level, the more powerful the creature. The game caps spawned creatures at level 9, so anything higher is treated as 9.
There is also a caution for item spawning: Items spawned using this command will appear one by one. Therefore, spawning thousands of items all at once could overload the game and cause it to freeze or crash.
Overall, the "spawn" command is useful when you need a particular item, creature, or character quickly for testing purposes or specific scenarios. It is often used in creative gameplay or troubleshooting to circumvent normal resource gathering and progression to save time. However, over-reliance on this command can detract from the intended game experience.
spawn Command
Remove brackets [ ] when typing the command.
Parameters
- Item ID
- The ID of the item or the character (NPC) you want to spawn. These are case-sensitive. End the ID with a star to spawn every entity containing that word, so Trophy* spawns the lot.
- AmountNumberOptional
- The amount of the item you want to spawn. If not specified, the default amount of 1 will be spawned.
- LevelNumberOptional
- The level of the character you want to spawn — the higher the level, the tougher the creature. Anything above 9 is capped at 9. On items this sets quality instead and is capped at 4. If not specified, the default level of 1 is used.
- RadiusNumberOptional
- How widely multiple spawns are scattered around the spawn point. Only has an effect when the amount is 2 or more — a single spawn always lands in the same place. Defaults to 0.5.
- p / e / iOptional
- Choose one flag: p picks the spawned items up, e also uses or equips them, and i only spawns and picks them up when you do not already have one.
Command builder
Fill in the arguments below to build a ready-to-paste spawn command.
Examples
Here are examples of how to use spawn.
This command will spawn 1 flint axe.
This command will spawn 5 flint axes.
This command will spawn 80 individual pieces of wood.
This command will spawn 4 Deer.
This command will spawn 4 level 3 Deer.
Spawns 80 wood scattered across a 3 metre radius instead of landing in a single pile. The level has to be given first, because the radius is the fourth value.
Spawns a flint axe and puts it straight into your inventory. Use e instead to also equip it.
Spawns every entity with 'trophy' in its name — the whole trophy set at once. Handy for filling a trophy wall, but it drops a lot of items in one go.
Spawns a Neck that hops non-stop. m_jumpInterval is the delay in seconds between jumps, so a near-zero value makes it jump constantly.
Spawns a nearly blind Greydwarf that cannot see you until you are about 5 metres away.
Spawns a Boar that spots you from 100 metres away and swims after you instead of stopping at the shoreline. Two fields set at once — add as many as you like.
Setting Fields on Spawn
Add one or more Component.field::value arguments to spawn and the creature arrives with those values already applied. This is how you get a Neck that never stops hopping: spawn Neck MonsterAI.m_jumpInterval::0.001.
The prefix is the component that creature actually carries, and it varies by creature — hostile creatures like Neck, Greydwarf and Boar use MonsterAI, while passive animals like Deer use AnimalAI. The values stick to the creature rather than your session, so they survive a save and reload, and everyone else on the server sees the same behaviour.
- m_jumpIntervalfloat
Seconds between jumps. A tiny value like
0.001makes it hop constantly;0stops it jumping at all.- m_viewRangefloat
How far away it can see you. Drop it to
5.0and it stays effectively blind until you are almost on top of it.- m_viewAnglefloat
How wide its cone of vision is, in degrees. Widen it and flanking stops working.
- m_hearRangefloat
How far away it can hear you moving.
- m_alertRangefloat
How close a target has to get before it reacts. Sneaking shrinks this, so a lower value makes the creature far easier to slip past.
- m_avoidWaterbool
Whether it keeps out of deep water. Set it to
falseand a land creature will swim after you.- m_afraidOfFirebool
Whether fire frightens it into running away. Set it to
trueand a campfire becomes a working deterrent.
The value has to match the field's type. A decimal field needs a decimal point:
MonsterAI.m_jumpInterval::1is read as a whole number and quietly does nothing, whileMonsterAI.m_jumpInterval::1.0works.Entity names are case-sensitive —
spawn Neckworks,spawn neckdoes not.Use the component the creature actually carries:
MonsterAIfor hostile creatures,AnimalAIfor passive animals like Deer. A component name it does not have is ignored.Set as many fields as you like in one command — add one
Component.field::valueargument for each.Anything the creature tracks for itself — whether it is asleep, alerted, aggravated or patrolling — cannot be pinned this way. It gets overwritten the moment the creature wakes up.