# Swords

## swords.yml

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

This is an example sword, you'll notice some interesting sections, like play\_particle, reduce\_durability which helps you to customize your items to have the best roleplay experience. (these attributes are described in the events page)

{% content-ref url="/pages/-Lb3KtOsE1uDppuAH63a" %}
[Events](/itemsadder/items-properties/events.md)
{% endcontent-ref %}

## Here is an example sword

This sword has a custom lore, has the same durability as diamond sword, 6 attack damage, 2.1 speed.\
When you left click or right click it plays enchant table particle, on attack it plays lightsaber sound (custom sound in resourcepack).\
It's crafted using rubys and stick.

```yaml
mysword:
    enabled: true # use this to enable or disable the item
    permission: mysword #crafting permission name (ia.craft.mysword)
    model_id: 6 #this is a special property to assign the custom texture 
    vanilla_type: DIAMOND_SWORD #this is a special property,
                # item will have the same durability of this vanilla item and custom texture
                # will be applied to this vanilla item ( in this case you must create
                # the texture under resourcepack folder "new_diamond_sword")
    name: '&fMySword' #display name of the item
    lore:
      - '&fWow this is my first'
      - '&fcustom sword!'
    enchants: #enchants to be applied on craft
      - FIRE_ASPECT:1 #<enchant name>:<level>
    specific_properties:
      attack_damage: 6
      attack_speed: 2.1
      hide_attributes: false
      hide_enchants: false
      damage_value: 249
    events: #events related to this item
      left_click: #when user left click
        play_particle: ENCHANTMENT_TABLE #plays a specific particle
      right_click:
        play_particle: ENCHANTMENT_TABLE #plays a specific particle
      attack: #when user attacks a mob or player
        play_particle: ENCHANTMENT_TABLE #plays a specific particle
  	    play_sound: lightsaber #plays a specific sound (custom or vanilla Minecraft)
    recipe: #recipe settings
      enabled: true #use this to enable or disable the crafting
      pattern: #pattern of the recipe, X is used to indicate empty slot
        - XRX
        - XRX
        - XSX
      ingredients: #ingredients match with recipe letters, 
                   #you can use custom items names and vanilla names
      R: ruby
      S: STICK

```

## Specific properties for swords

```yaml
specific_properties:
    attack_damage: 1 # attack damage
    attack_speed: 4 # attack speed
    hide_attributes: true # hide attack and speed attributes from lore
    hide_enchants: false # hide enchant from lore
    damage_value: 249 # sets an initial damage value for the item. so when you craft
                # this sword your'll get an already consumed item (useful if)
                # you want to give players a special item that needs to
                # be recharged (like the philosopher_stone)
```


---

# 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/swords.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.
