# Signal Stick

{% hint style="info" %}
MCPets 4.0.0 introduced the **in-game editor** to simply modify pet options in game, so make sure to check it out using `/mcpets editor`

That will save you some time not diving in configurations anymore!
{% endhint %}

## What for ?

The Signal stick is a tool that enables you to order your pet to cast skills from MythicMobs. It comes as an item in game that you can customize however you want for each pet.

It comes with two options :

* Left click to switch order (get the next order in the list circularly)
* Right click to cast the order (cooldown can be managed through MythicMobs)

If you want to have a look at what you can achieve with the signal stick, jump at 1:00 on this trailer video:

{% embed url="<https://youtu.be/HdhAh1C8RcQ?t=60>" %}
[Drakonin Pack](https://mcmodels.net/model/drakonin-pack/) - by [Nocsy](https://mcmodels.net/vendors/nocsy/)
{% endembed %}

## How to ?

The Signal stick item is unique for each pet. Also it can be customized using a resource pack (customModelData) or a head (using textureBase64).

The exemple below shows you how to implement the signal stick into the pet config. Have a look at the [pet config example](https://mcpets.gitbook.io/mcpets/tutorials/config-templates/pet-config) if you still have some doubts on how to add this YAML code into your pet config.

The Signal Stick heavily relies on the[ Signal system of MythicMobs](https://git.mythiccraft.io/mythiccraft/MythicMobs/-/wikis/skills/mechanics/signal). Check out[ their wiki page](https://git.mythiccraft.io/mythiccraft/MythicMobs/-/wikis/skills/mechanics/signal) to learn how to implement it in the mob before you try to trigger them using the signal stick of MCPets.

All of the features you can use are also explained below so you can see what it can be used for, note that some of them are optional so you don't need to fill them all.

```yaml
Signals:
  # List the signals you want to cast to the pet (can be empty)
  # Make sure the pet is actually listening to these signals in MythicMobs or nothing will happen
  # For more information on Signals, check out MythicMobs wiki : https://git.mythiccraft.io/mythiccraft/MythicMobs/-/wikis/skills/mechanics/signal
  Values:
  - ATTACK
  - JUMP
  # Setup the Signal Stick item, it uses the same constructor type as the icon
  Item:
    # Says whether the signal stick item should be available in the interaction menu or not
    # Put false if you want players to get it from another way (like if you added a crafting method, or an NPC that could give it etc...)
    # See the commands for "signalstick" here for more information : https://app.gitbook.com/s/agejyp4OPFjyLRX5Q3cX/~/changes/hJm7QZW7HaVPhmJ6Ct1F/tutorials/plugin-features/commands
    GetFromMenu: true 
    Name: Signal stick name
    Material: STICK
    CustomModelData: 0
    Description:
    - You have a ton to explain here
    - on how to use the stick maybe
```

### Note about signal stick

* **Giving yourself the signal stick**:
  * To give yourself a pre-configured signal stick, you can use the `/mcpets signalStick <player> <petId>` command. You can also turn any item into a working signal stick for the pet using `/mcpets signalStick <petId>` command. Check out the [commands here](https://mcpets.gitbook.io/mcpets/tutorials/plugin-features/commands).
* **Prevention of bugs and exploits**:
  * Signal sticks can not be placed in most crafting stations to prevent players from accidently destroying it, or exploit it to create other items.

## Example usage

Let's give an example to show you how to implement an order to your pet.

Let's go into your mob config, usually into *"./plugins/MythicMobs/Mobs/"*.

Let's say you want your pet to deal damage to non-player entities in a radius of 3 around the pet, when the player cast a signal `ATTACK` to his pet. This would go like this into the `Skills` sections of your mob config:

```yaml
Skills:
  - damage{a=10} @EntitiesNearOrigin{r=3;ignore=players;} ~onSignal:ATTACK
```

Then, within the pet config into *"./plugins/MCPets/Pets/"*, you want to add the following:

```yaml
Signals:
  Values:
  - ATTACK
  Item:
    GetFromMenu: true 
    Name: Signal stick name
    Material: STICK
    CustomModelData: 0
    Description:
    - Right click to cast a signal to your pet
```

This will enable the player to get the Signal Stick from the pet's interaction menu, and then cast an `ATTACK` signal when right clicking with the signal stick.

For more advanced skills to use, make sure to check [MythicMobs wiki](https://git.mythiccraft.io/mythiccraft/MythicMobs/-/wikis/Skills/Mechanics).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mcpets.gitbook.io/mcpets/tutorials/pet-features/signal-stick.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
