# Pet JSON Commands

## When are the commands run?

The commands you add have different 'reasons' for when they are run, These reasons are listed below:

* <mark style="color:blue;">`SPAWN`</mark> - Will run the commands listed when the pet is spawned
* <mark style="color:blue;">`REVOKE`</mark> - Will run the commands listed when the pet is removed
* <mark style="color:blue;">`RIDE`</mark> - Will run the commands listed when the player mounts the pet
* <mark style="color:blue;">`RIDE_DISMOUNT`</mark> - Will run the commands listed when the player dismounts off the pet
* <mark style="color:blue;">`HAT`</mark> - Will run the commands listed when the pet is put on the players head
* <mark style="color:blue;">`TELEPORT`</mark> - Will run the commands listed when the pet teleports
* <mark style="color:blue;">`FAILED`</mark> - Will run the commands listed when a task for the pet fails to run <mark style="color:green;">`(like failed spawning)`</mark>

## Command Placeholders

We have added some placeholders to the pet commands, there could always be more added but these are the current ones added:

<table><thead><tr><th width="158.14963731185236" align="center">Placeholder</th><th>Description</th></tr></thead><tbody><tr><td align="center">{petX}</td><td>This is the X coordinate of the pet</td></tr><tr><td align="center">{petY}</td><td>This is the Y coordinate of the pet</td></tr><tr><td align="center">{petZ}</td><td>This is the Z coordinate of the pet</td></tr><tr><td align="center">{ownerX}</td><td>This is the X coordinate of pets owner</td></tr><tr><td align="center">{ownerY}</td><td>This is the Y coordinate of pets owner</td></tr><tr><td align="center">{ownerZ}</td><td>This is the Z coordinate of pets owner</td></tr><tr><td align="center">{ownerName}</td><td>This is the name for the player who spawned the pet</td></tr><tr><td align="center">{petName}</td><td>This is the pets display name</td></tr><tr><td align="center">{petType}</td><td>This is the type of pet <mark style="color:green;"><code>(EG: COW, PIG, ETC.)</code></mark></td></tr><tr><td align="center">{petUUID}</td><td>The UUID for the pet</td></tr></tbody></table>

## Some examples of how to add commands

```json
  "commands": {
    "SPAWN": [
      "say {ownerName} has spawned the {petType} pet"
    ],
    "REVOKE": [
      "say {ownerName} has removed the {petType} pet",
      "tell {ownerName} would you like to spawn another? Type /pet gui"
    ],
    "RIDE": [
      
    ],
    "RIDE_DISMOUNT": [
      
    ],
    "HAT": [
      
    ],
    "TELEPORT": [
      
    ],
    "FAILED": [
      "tell {ownerName} An error occurred when trying this task"
    ]
  }
```

}
