# games.cavu.entityClass

> Published by [pardy.at](https://lexicon.garden/identity/did:plc:dp7v5b5kejmmzzpwmqyf5wj6)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.entityClass)
- [Documentation](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.entityClass/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.entityClass/examples)

## Definitions

### `games.cavu.entityClass`

**Type**: `record`

An entity class to share between games: a Lua script returning the class table (handlers, project, view, synced, ...), run sandboxed by the Cavu entity engine. A game lists it in its manifest under `classes` by the name it gives it ("walker": "at://did/games.cavu.entityClass/rkey"), and its own classes may extend it by that name.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `description` | `string` | No |  |
| `extends` | `string` | No | The class name it extends, if any (resolved in the game that loads it). |
| `fields` | `unknown` | No | Optional: the fields its entities carry, documented (name -> description), for authoring tools. |
| `license` | `string` | No |  |
| `name` | `string` | Yes | A suggested name (games choose their own). |
| `script` | `string` | Yes | Lua source returning the class table. It sees the standard libraries, spairs, path_at, update, copy_list, ent.is_a / lookup / kind / raw and (client) ui, sprites, motion; nothing else. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "An entity class to share between games: a Lua script returning the class table (handlers, project, view, synced, ...), run sandboxed by the Cavu entity engine. A game lists it in its manifest under `classes` by the name it gives it (\"walker\": \"at://did/games.cavu.entityClass/rkey\"), and its own classes may extend it by that name.",
      "key": "any",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "description": {
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          },
          "extends": {
            "description": "The class name it extends, if any (resolved in the game that loads it).",
            "maxLength": 64,
            "type": "string"
          },
          "fields": {
            "description": "Optional: the fields its entities carry, documented (name -> description), for authoring tools.",
            "type": "unknown"
          },
          "license": {
            "maxLength": 128,
            "type": "string"
          },
          "name": {
            "description": "A suggested name (games choose their own).",
            "maxLength": 64,
            "type": "string"
          },
          "script": {
            "description": "Lua source returning the class table. It sees the standard libraries, spairs, path_at, update, copy_list, ent.is_a / lookup / kind / raw and (client) ui, sprites, motion; nothing else.",
            "maxLength": 200000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "script",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "games.cavu.entityClass",
  "lexicon": 1
}
```
