Skip to main content
POST
/
template
/
create
define a named entity template
curl --request POST \
  --url http://localhost:3917/template/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "color": "red",
  "health": 100,
  "mesh": "cube",
  "name": "red-cube",
  "team": 1
}
'
{
  "ok": true,
  "template": "red-cube"
}

Body

application/json

A name plus the same fields as a SpawnRequest (mesh, color, health, team, collider, physics_body, …). The whole body is stored under name and replayed by POST /template/spawn.

The body is of type any.

Response

200 - application/json

Template stored under its name. Returns ok:false with an error when the name is missing or the body fails to parse as a SpawnRequest.