create_entities
Create one or more entities in the PlayCanvas Editor, enabling the definition of properties like name, position, rotation, scale, tags, and components, as well as parent-child hierarchies for 3D application development.
Instructions
Create one or more entities
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entities | Yes | Array of entity hierarchies to create. |
Implementation Reference
- src/tools/entity.ts:10-21 (registration)Registration of the MCP tool 'create_entities'. Includes inline input schema validation using Zod and a handler function that proxies the call to the WebSocket server via wss.call('entities:create', entities). This constitutes the full tool implementation in the MCP context.'create_entities', 'Create one or more entities', { entities: z.array(z.object({ entity: EntitySchema, parent: EntityIdSchema.optional().describe('The parent entity to create the entity under. If not provided, the root entity will be used.') })).nonempty().describe('Array of entity hierarchies to create.') }, ({ entities }) => { return wss.call('entities:create', entities); } );
- src/tools/entity.ts:18-20 (handler)The handler function for the 'create_entities' tool, which receives the validated 'entities' input and forwards it to the backend via wss.call('entities:create', entities).({ entities }) => { return wss.call('entities:create', entities); }
- src/tools/entity.ts:13-16 (schema)Input schema for 'create_entities' tool using Zod: non-empty array of objects with 'entity' (EntitySchema) and optional 'parent' (EntityIdSchema).entities: z.array(z.object({ entity: EntitySchema, parent: EntityIdSchema.optional().describe('The parent entity to create the entity under. If not provided, the root entity will be used.') })).nonempty().describe('Array of entity hierarchies to create.')