# Guns

### guns.yml

This is the file where all custom guns behaviour and config are stored

## Example gun

```yaml
revolver_gun:
  enabled: true
  permission: revolver_gun
  model_id: 1
  vanilla_type: GOLDEN_SWORD
  name: '&fRevolver'
  specific_properties:
    projectile: projectile
  events:
    gun_shot:
      play_sound: revolver_shot
      play_effect: SMOKE
    gun_no_ammo:
      play_sound: revolver_no_ammo
  craft_recipe:
    enabled: true
    pattern:
      - III
      - ISX
      - WXX
    ingredients:
      I: IRON_INGOT
      S: STICK
      W: SPRUCE_PLANKS
```

### Specific properties

```yaml
specific_properties:
    projectile: projectile
```

Guns have a specific property which identifies the compatible projectile.\
To use guns you must hold the specified custom item in left hand while shoting with gun.

{% hint style="info" %}
You can create projectiles in items.yml file, it contains generic items which has no particular functionality in the game (ingredients for recipes and some little objects)
{% endhint %}

### Events

```yaml
events:
  gun_shot: #event called when user shots
    play_sound: revolver_shot #play a sound (vanilla or custom)
    play_effect: SMOKE #play an effect
  gun_no_ammo: #event called when user has no projectiles left
    play_sound: revolver_no_ammo #play a sound (vanilla or custom)
```


---

# 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://lonedev.gitbook.io/itemsadder/specific-items/guns.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.
