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

# effects

{% tabs %}
{% tab title="EN" %}

## 💥 Visual Effects Configuration

Visual effects can be configured directly inside individual weapon model configuration YML files to customize firing animations, bullet decals, and close combat markers.

{% stepper %}
{% step %}

### Muzzle Flash (3D Model Bone Mesh)

This setting controls which bone in your Blockbench model represents the 3D muzzle flash texture/mesh. It is made visible for 2 ticks (0.1 seconds) when firing.

```yaml
# Muzzle flash bone and size scale multipliers
muzzle_flash.bone: "aim"                   # The Blockbench bone to show (e.g. muzzle)
muzzle_flash.scale: 1.0                    # Mesh scale multiplier
```

{% endstep %}

{% step %}

### Muzzle Flash (Temporary Block Light)

Generates a dynamic Minecraft light source at the tip of the weapon's barrel when firing, lighting up dark environments momentarily.

```yaml
muzzle-flash.enabled: true                 # Toggle light emission on fire
muzzle-flash.level: 15                     # Light level (0 to 15, 15 is brightest)
muzzle-flash.duration: 2                   # Time to display in ticks (2 ticks = 0.1 seconds)
muzzle-flash.offset.x: 0.0                 # Position offsets relative to weapon eye line
muzzle-flash.offset.y: 0.0
muzzle-flash.offset.z: 1.0                 # Emitted 1 block ahead of camera
```

{% endstep %}

{% step %}

### Bullet Holes Decals

Spawns temporary text display entities representing bullet impact holes on block surfaces hit by projectiles.

```yaml
bullet-hole.enabled: true                  # Toggle bullet hole decals
bullet-hole.text: "&0⚫"                    # Decal character symbol (supports colors, e.g. &0 = black)
bullet-hole.scale: 0.8                     # Decal text size scale
bullet-hole.duration: 500                  # Lifetime in server ticks (500 ticks = 25 seconds)
```

{% endstep %}

{% step %}

### Slash Marks (Melee Weapons Only)

Displays a floating slashing visual mark in the air when players swing close combat items like knives or swords.

```yaml
slash-mark.enabled: true                   # Toggle melee slash marks
slash-mark.text: "&c/"                     # Slash character/symbol (e.g., &c = red slash)
slash-mark.distance: 2.0                   # Spawn distance in front of player (blocks)
slash-mark.scale: 1.0                      # Mark size scale
slash-mark.duration: 100                   # Lifetime in server ticks (100 ticks = 5 seconds)
```

{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="TH" %}

## 💥 การตั้งค่าเอฟเฟกต์ภาพ (Visual Effects)

คุณสามารถเพิ่มตัวเลือกเอฟเฟกต์ภาพพิเศษเพื่อเพิ่มความสมจริงขณะยิงหรือโจมตีได้ โดยเขียนกำหนดไว้ภายในไฟล์ตั้งค่า YAML ของอาวุธแต่ละชิ้น

{% stepper %}
{% step %}

### ไฟปากกระบอกปืนแบบโมเดล 3D (3D Muzzle Flash)

เป็นการดึงกระดูกส่วนที่เป็นรูปโมเดลประกายไฟสามมิติ (Muzzle Flash Mesh) ที่ปั้นไว้ใน Blockbench ให้กะพริบแสดงผลออกมาเป็นเวลา 2 ticks (0.1 วินาที) ทุกครั้งที่มีการกดยิงกระสุน:

```yaml
# ลำกล้องกระบอกปืนและขนาดประกายไฟ
muzzle_flash.bone: "aim"                   # ชื่อกระดูกไฟปากกระบอกปืนใน Blockbench
muzzle_flash.scale: 1.0                    # ตัวคูณปรับขนาดของโมเดลประกายไฟ
```

{% endstep %}

{% step %}

### แสงไฟส่องสว่างตอนยิง (Muzzle Flash Block Light)

เป็นการสร้างแสงสว่างจากบล็อกแสงแบบจำลองของ Minecraft ขึ้นมาตรงปากกระบอกปืนชั่วคราวเวลาที่ยิง ทำให้ยิงในที่มืดแล้วรอบข้างสว่างแวบขึ้นมาเหมือนปืนจริง:

```yaml
muzzle-flash.enabled: true                 # เปิดใช้งานการปล่อยแสงไฟตอนกดยิง
muzzle-flash.level: 15                     # ระดับความสว่างของแสง (0 ถึง 15, 15 คือสว่างสุด)
muzzle-flash.duration: 2                   # ระยะเวลาปล่อยแสง (หน่วยเป็น Tick: 2 ticks = 0.1 วินาที)
muzzle-flash.offset.x: 0.0                 # พิกัดเลื่อนตำแหน่งของแสงเมื่อเทียบกับตัวปืน
muzzle-flash.offset.y: 0.0
muzzle-flash.offset.z: 1.0                 # แสงไฟจะโผล่หน้ากล้องไป 1 บล็อก
```

{% endstep %}

{% step %}

### รอยรูกระสุนเกาะบล็อก (Bullet Holes)

สร้างรอยรูกระสุนปืนทิ้งไว้ตามกำแพงหรือบล็อกที่โดนยิง โดยระบบจะใช้ Text Display Entity แสดงผลขึ้นมา:

```yaml
bullet-hole.enabled: true                  # เปิดใช้งานระบบทิ้งรอยกระสุนปืน
bullet-hole.text: "&0⚫"                    # ตัวอักษรแสดงสัญลักษณ์รอยปืน (รองรับโค้ดสี เช่น &0 = สีดำ)
bullet-hole.scale: 0.8                     # ตัวคูณขนาดของรูกระสุน
bullet-hole.duration: 500                  # ระยะเวลาแสดงผล (หน่วยเป็น Tick: 500 ticks = 25 วินาที)
```

{% endstep %}

{% step %}

### เอฟเฟกต์รอยฟันมีด (Slash Marks - หมวด MELEE เท่านั้น)

สำหรับมีดหรือดาบ ระบบจะแสดงรอยแผลฟันแหวกอากาศสีขาวหรือสีแดงลอยค้างหน้าตัวละครชั่วขณะเมื่อทำการโจมตีใกล้ตัว:

```yaml
slash-mark.enabled: true                   # เปิดใช้งานรอยฟันดาบเมื่อกวดมีดฟัน
slash-mark.text: "&c/"                     # ตัวอักษรแสดงสัญลักษณ์รอยฟัน (เช่น &c = สีแดง)
slash-mark.distance: 2.0                   # ระยะห่างพิกัดการปรากฏตัวด้านหน้าผู้เล่น (หน่วยบล็อก)
slash-mark.scale: 1.0                      # ขนาดของรอยแผลฟัน
slash-mark.duration: 100                   # ระยะเวลาแสดงผล (หน่วยเป็น Tick: 100 ticks = 5 วินาที)
```

{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

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

```
GET https://kbanimation.gitbook.io/kbanimation/effects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
