Mob Drop System¶
The Mob Drop System allows custom items to drop from mobs when they are killed, with configurable entity types, drop chances, and quantities.
Configuration¶
Mob drops are defined per-item in the item's YAML file:
mob-drops:
zombie_drop:
entity-type: ZOMBIE
chance: 0.05
min-amount: 1
max-amount: 1
skeleton_drop:
entity-type: SKELETON
chance: 0.1
min-amount: 1
max-amount: 3
Properties¶
| Property | Type | Default | Description |
|---|---|---|---|
entity-type |
String | — | Bukkit EntityType name (e.g., ZOMBIE, SKELETON) |
chance |
Double | 0.05 |
Drop probability from 0.0 (0%) to 1.0 (100%) |
min-amount |
Integer | 1 |
Minimum number of items to drop |
max-amount |
Integer | 1 |
Maximum number of items to drop |
Supported Entity Types¶
Any living entity type is supported. Common examples:
| Entity | Key |
|---|---|
| Zombie | ZOMBIE |
| Skeleton | SKELETON |
| Creeper | CREEPER |
| Spider | SPIDER |
| Enderman | ENDERMAN |
| Wither Skeleton | WITHER_SKELETON |
| Blaze | BLAZE |
| Pillager | PILLAGER |
| Warden | WARDEN |
Living Entities Only
Only entities that extend LivingEntity (i.e., EntityType.isAlive() returns true) are valid. Non-living entities like arrows or boats will fail validation.
How It Works¶
- The
MobDropListenerlistens forEntityDeathEvent - When a mob dies, it checks all custom items for matching mob drops
- For each matching drop, it rolls against the
chancevalue - If successful, it generates a random amount between
min-amountandmax-amount - The custom item is dropped at the mob's death location
Multiple Drops¶
An item can have drops from multiple entity types:
mob-drops:
common_drop:
entity-type: ZOMBIE
chance: 0.05
min-amount: 1
max-amount: 1
rare_drop:
entity-type: ENDER_DRAGON
chance: 1.0
min-amount: 1
max-amount: 3
Validation¶
A mob drop configuration is valid when:
entity-typeis a validEntityTypename- The entity type represents a living entity
chanceis between0.0and1.0min-amountis at least1max-amountis greater than or equal tomin-amount