# pet.trezy.dropFood

> Published by [trezy.pet](https://lexicon.garden/identity/did:plc:ollch4g7tes2reb5eceiwuol)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.dropFood)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.dropFood/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.dropFood/examples)

## Definitions

### `pet.trezy.dropFood`

**Type**: `procedure`

Put one morsel on the ground. Writes to the caller's terrarium space; the space is created lazily by the first drop, so a player who never feeds anything never gets one.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `x` | `integer` | Yes | Horizontal position in scaled world px. |
| `food` | `string` | Yes | The id of a published pet.trezy.food. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rkey` | `string` | No | The morsel's key in the space. What the client passes back as createInteraction's `drop` when a pet eats it. |
| `error` | `string` | No | Present instead of rkey/droppedAt when the drop was refused for an expected reason. A stable machine code the client branches on — add codes, never rename them. |
| `message` | `string` | No | A sentence to show the player, accompanying `error`. Free to reword; do not branch on it. |
| `droppedAt` | `string` (datetime) | No |  |

## Raw Schema

```json
{
  "id": "pet.trezy.dropFood",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "food",
            "x"
          ],
          "properties": {
            "x": {
              "type": "integer",
              "description": "Horizontal position in scaled world px."
            },
            "food": {
              "type": "string",
              "description": "The id of a published pet.trezy.food."
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "required": [],
          "properties": {
            "rkey": {
              "type": "string",
              "description": "The morsel's key in the space. What the client passes back as createInteraction's `drop` when a pet eats it."
            },
            "error": {
              "type": "string",
              "description": "Present instead of rkey/droppedAt when the drop was refused for an expected reason. A stable machine code the client branches on — add codes, never rename them.",
              "knownValues": [
                "not-authenticated",
                "unknown-food",
                "bad-position",
                "terrarium-full",
                "save-failed"
              ]
            },
            "message": {
              "type": "string",
              "description": "A sentence to show the player, accompanying `error`. Free to reword; do not branch on it."
            },
            "droppedAt": {
              "type": "string",
              "format": "datetime"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Put one morsel on the ground. Writes to the caller's terrarium space; the space is created lazily by the first drop, so a player who never feeds anything never gets one."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
