Spawn an entity
ent_spawnCreates a frozen or physics-enabled entity in the server realm, setting class, model, position, angles and keyvalues before spawning. Use it to place props or NPCs on a loaded map.
Instructions
Creates an entity in the server realm, in this order: ents.Create(class), SetModel, SetPos, SetAngles, SetKeyValue for each keyvalue (values sent as strings), Spawn, Activate, then freeze. It stays until removed or the map changes. Result: the entity summary {id, class, model, name, pos, ang}. Error invalid_class if the class does not exist. Example: {"class": "prop_physics", "model": "models/props_c17/oildrum001.mdl", "pos": [0, 0, 100], "freeze": true}. Needs a loaded map (map_load): the server and client realms do not exist at the main menu.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"class": "<class>"
},
"name": "ent_spawn"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ang | No | Angles [pitch, yaw, roll] in degrees. | |
| pos | No | Position, [x, y, z] in Hammer units (default: the origin). | |
| class | Yes | Entity class, e.g. prop_physics, npc_citizen. | |
| model | No | Model path, e.g. models/props_c17/oildrum001.mdl. | |
| freeze | No | Disable physics motion after spawning (default false). | |
| instance | No | Optional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance. | |
| keyvalues | No | Map keyvalues set before Spawn, e.g. {"targetname": "test"}. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| ang | No | ||
| pos | No | ||
| name | No | ||
| next | No | ||
| nick | No | ||
| note | No | ||
| class | No | ||
| model | No | ||
| warning | No | ||
| distance | No | ||
| next_call | No | ||
| answered_by | No | ||
| truncated_note | No | ||
| version_warning | No |