> For the complete documentation index, see [llms.txt](https://docs.ragnasync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ragnasync.com/event-logs/drops/mob-item-drop-log.md).

# Mob Drops

Logs rare item drops when a player directly kills a monster

The `MobItemDropScript` handles item drop logging when a **player directly kills** a monster.

## Action

`mob_item_drop`

## When It's Used

This script is triggered when:

* A player lands the killing blow on a monster
* The monster drops an item with a drop rate at or below the configured threshold
* Mob item drop logging is enabled in the server configuration

## Why Use It

* **Track valuable drops** from normal gameplay where players are actively hunting
* **Monitor rare card drops** across the server
* **Celebrate player achievements** by announcing rare drops to Discord
* **Audit drop rates** to ensure game balance

## Server Configuration

In `conf/channels.conf`:

```
// Player item drop logging
ragnasync_mob_item_drop_log_enabled: true
ragnasync_mob_item_drop_log_channel_id: "YOUR_CHANNEL_ID"
ragnasync_mob_item_drop_log_min_rate: 100
ragnasync_mob_item_drop_log_types: "card,weapon,armor"
```

| Setting      | Description                                   | Default |
| ------------ | --------------------------------------------- | ------- |
| `enabled`    | Enable/disable this logging type              | `false` |
| `channel_id` | Discord channel ID to send messages to        | -       |
| `min_rate`   | Minimum drop rate to log (500 = 5%, 100 = 1%) | `500`   |
| `types`      | Item categories to log — see below            | `all`   |

### Valid `types` values

This filter matches against **item categories**, not the mob class that dropped them. Comma-separated, case-insensitive.

| Token        | Filters drops of                   |
| ------------ | ---------------------------------- |
| `all`        | Every item category (default)      |
| `healing`    | Healing items                      |
| `usable`     | Consumables / usable items         |
| `etc`        | Miscellaneous / crafting materials |
| `armor`      | Armor pieces                       |
| `weapon`     | Weapons                            |
| `card`       | Monster cards                      |
| `petegg`     | Pet eggs                           |
| `petarmor`   | Pet equipment                      |
| `ammo`       | Arrows, bullets, other ammunition  |
| `shadowgear` | Shadow equipment                   |
| `cash`       | Cash shop items                    |

{% hint style="warning" %}
`"mvp,miniboss"` is a common mistake here — those are mob classes, not item categories, so every token gets rejected. If your filter produces `[Warning]: Unknown item type '...'` lines at map-server startup, check that your tokens match the table above.
{% endhint %}

{% hint style="info" %}
There's no built-in way to filter by the **mob class** that dropped the item (e.g. "only log drops from MVPs"). Use `min_rate` to narrow down rare drops, or route messages through the dashboard for mob-specific alerts.
{% endhint %}

**Drop Rate Values:**

| Value   | Rate |
| ------- | ---- |
| `10000` | 100% |
| `1000`  | 10%  |
| `500`   | 5%   |
| `100`   | 1%   |
| `10`    | 0.1% |

## Message Format

The script sends formatted messages to Discord using monospace code blocks:

**With drop rate (≤100%):**

```
💎 Item Drop:     | PlayerName       | Poring           | Apple                | 5.00%   |
```

**Without drop rate (>100%):**

```
💎 Item Drop:     | PlayerName       | Poring           | Apple                |
```

The columns are: Player, Monster, Item, and Drop Rate (hidden for common drops over 100%).

Each drop type uses a unique emoji:

* 💎 Mob drops (player kills)
* ⚔️ Mercenary drops
* 🐾 Homunculus drops

## Data Fields

| Field         | Type   | Description                               |
| ------------- | ------ | ----------------------------------------- |
| `player_name` | string | Name of the player who killed the monster |
| `mob_name`    | string | Name of the monster that was killed       |
| `mob_id`      | int    | Monster ID                                |
| `item_name`   | string | Name of the dropped item                  |
| `item_id`     | int    | Item ID                                   |
| `rate`        | float  | Drop rate (e.g., 500 = 5.00%)             |
| `account_id`  | int    | Player's account ID                       |
| `char_id`     | int    | Player's character ID                     |
| `channel`     | string | Discord channel ID                        |

## Example Use Cases

### Card Drop Alerts Only

Set a very low threshold to only log card drops:

```
ragnasync_mob_item_drop_log_min_rate: 2  // Only 0.02% or rarer
```

### All Rare Drops

Log anything 10% or rarer:

```
ragnasync_mob_item_drop_log_min_rate: 1000
```

## Custom Messages

Want to customize how these messages look? Head to the **Message Routes** page on your dashboard, set the format to **Custom Message**, and compose your own template using `{{placeholder}}` syntax.

**Example template:**

```
:gem: {{player_name}} got {{item_name}} from {{mob_name}}! ({{rate}})
```

**Available placeholders for this event:**

| Placeholder        | Example                                        |
| ------------------ | ---------------------------------------------- |
| `{{player_name}}`  | Marky                                          |
| `{{mob_name}}`     | Poring                                         |
| `{{mob_id}}`       | 1002                                           |
| `{{item_name}}`    | Apple                                          |
| `{{item_id}}`      | 512                                            |
| `{{rate}}`         | 50.00%                                         |
| `{{rate_raw}}`     | 5000                                           |
| `{{src_template}}` | :gem: \[Card Drop] Marky obtained Poring Card! |

{% hint style="info" %}
`{{src_template}}` contains the pre-formatted message from your game server's `[template: ...]` field. If your server doesn't send one, it resolves to empty. See [Message Templates](/ragnascript/message-templates.md) for details.
{% endhint %}

See [Message Routing](/ragnascript/message-routing.md) for more about formats, conditions, and multi-channel routing.
