> For the complete documentation index, see [llms.txt](https://mossuh.gitbook.io/projects/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mossuh.gitbook.io/projects/plugins/moarmors/api.md).

# API

## Main Class:&#x20;

```
ArmorsAPI
```

## Events

### PieceChangeExpEvent

Called whenever an armor piece changes experience.

```java
// This event is cancellable

@EventHandler
public pieceEvent(PieceChangeExpEvent event) {
    UUID uuid = event.getUUID(); // The player uuid
    Piece piece = event.getPiece(); // The piece who receive the exp.
    
    // Shows if the exp was received by NATURAL, REWARDS or COMMAND.
    ExecuteType execute = event.getExecuteType();
    // Shows if the exp was setted (SET) or added (ADD).
    ReceiveType receive = event.getReceiveType();
    
    double exp = event.getExp();
    event.setExp(double exp);
    event.addExp(double exp);
}
```

### PieceChangeLevelEvent

Called whenever an armor piece changes level.

```java
// This event is cancellable

@EventHandler
public pieceEvent(PieceChangeLevelEvent event) {
    UUID uuid = event.getUUID(); // The player uuid
    Piece piece = event.getPiece(); // The piece who receive the exp.
    
    // Shows if the level was received by NATURAL, REWARDS or COMMAND.
    ExecuteType execute = event.getExecuteType();
    // Shows if the level was setted (SET) or added (ADD).
    ReceiveType receive = event.getReceiveType();
    
    int level = event.getLevel();
    event.setLevel(int level);
    event.addLevel(int level);
}
```

### PlayerChangePieceEvent

Called whenever a player changes an active armor piece.

```java
// This event is not cancellable

@EventHandler
public pieceEvent(PlayerChangePieceEvent event) {
    UUID uuid = event.getUUID(); // The player uuid
    Piece piece = event.getPiece(); // The piece who receive the exp.
    
    // Show it the changed piece was EQUIP or UNEQUIP
    EquipType equip = event.getEquipType();
    // Show how was detected the player equiped or unequiped the piece
    // Options: MANUAL, CLOSE_INVENTORY, PLAYER_JOIN, PLAYER_LEAVE, REPETITIVE, RESPAWN
    DetectorType detector = event.getDetectorType();
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://mossuh.gitbook.io/projects/plugins/moarmors/api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
