> For the complete documentation index, see [llms.txt](https://cjcrafter.gitbook.io/weaponmechanics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cjcrafter.gitbook.io/weaponmechanics/weapon-modules/melee.md).

# Melee

Add a bayonet to your gun, or create melee weapons like baseball bats

```yaml
  Melee:
    Enable_Melee: <true/false>
    Melee_Attachment: <melee weapon name>
    Melee_Range: <maximum melee range>
    Melee_Hit_Delay: <ticks>
    Melee_Miss:
      Mechanics: <Mechanics>
      Melee_Miss_Delay: <ticks>
      Consume_On_Miss: <true/false>
```

#### Enable\_Melee

Use `true` if this weapon is a melee weapon, like a knife, a bat, or a lightsaber. Otherwise, use the `Melee_Attachment` option (for bayonets).

#### Melee\_Attachment

Gives this weapon a non-removable bayonet. For example, if you have a melee weapon called `Tactical_Knife`, then use:

```yaml
  Melee:
    Melee_Attachment: Tactical_Knife
```

Your weapon will now "*inherit*" the melee properties of the knife.

#### Melee\_Range

How far the melee can hit people from. For best results, I recommend deleting this option altogether, which instead uses Minecraft's built in melee system.

#### Melee\_Hit\_Delay

The time in ticks (20 ticks = 1 second) between hits that deal damage.

#### Melee\_Miss

* `Mechanics`
  * Mechanics triggered when you miss.
  * Use [Mechanics](https://cjcrafter.gitbook.io/mechanics/) wiki.
  * To trigger mechanics on HITS, use [Damage](/weaponmechanics/weapon-modules/damage.md#mechanics) from damage.
* `Melee_Miss_Delay`
  * The time in ticks before you can hit again.
* `Consume_On_Miss`
  * When set to `true`, consumes ammo (if configured), durability (if configured), etc.


---

# 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://cjcrafter.gitbook.io/weaponmechanics/weapon-modules/melee.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.
