Lite Page Versions GitHub

Drop Rate API Mod

A Minecraft Forge mod for managing custom mob drops with JSON configuration and API integration.

Features

Installation

Add to your build.gradle:

repositories {
    maven {
        url "https://cursemaven.com"
    }
}

dependencies {
    implementation fg.deobf("curse.maven:droprateapi-1208468:6249868")
}
View CurseMaven Guide

Configuration

Create config/droprate.config.json:

{
    "config": [
        {
            "mob": "minecraft:zombie",
            "rate": 80,
            "item": ["minecraft:apple"],
            "item_amount": {
                "min_amount": 1,
                "max_amount": 3
            }
        }
    ]
}

Config Fields

FieldDescription
mobEntity ID (e.g., "minecraft:skeleton")
rateDrop chance (1-100)
itemArray of item IDs
item_amountNumber (fixed) or {min_amount, max_amount}

Note: Amounts are clamped between 1-64 automatically

Commands

/droprate_reload - Reload config without restarting

API Usage

API Package

Import

import th.tamkungz.droprateapi.api.DropRateAPI;

Requirement (1.16.5)

import net.minecraft.entity.EntityType;
import net.minecraft.item.Items;
import java.util.Arrays;
import java.util.List;
    

Register Drops Programmatically

DropRateAPI.registerDrop(
    EntityType.ZOMBIE, // Mob type
    75,                // 75% drop chance
    Arrays.asList(Items.DIAMOND, Items.EMERALD), // Items
    1,                 // Min amount
    5                  // Max amount
);

Remove Drops

// Remove all diamond drops from zombies
DropRateAPI.removeDrop(EntityType.ZOMBIE, Items.DIAMOND);

Example Configurations

Multiple Items with Fixed Amount

{
    "mob": "minecraft:creeper",
    "rate": 100,
    "item": ["minecraft:gunpowder", "minecraft:tnt"],
    "item_amount": 2
}

Random Quantity Range

{
    "mob": "minecraft:enderman",
    "rate": 40,
    "item": ["minecraft:ender_pearl"],
    "item_amount": {
        "min_amount": 2,
        "max_amount": 5
    }
}

Event Handling

Drops are processed in MobDeathHandler during the LivingDeathEvent. Each drop entry is evaluated independently.