Minecraft Developer Docs

DropRateAPI

Configure custom mob drops with JSON and integrate drop rules from Forge mods.

Minecraft ForgeJSON configDeveloper API

Overview

DropRateAPI adds a JSON-driven way to define extra mob drops and exposes a small API for other mods to register or remove drop rules at runtime.

  • Configure drops per mob entity ID.
  • Use percentage-based drop chances from 0 to 100.
  • Support fixed or ranged item amounts.
  • Reload configuration without restarting the game or server.

Installation

1
Download

Download the DropRateAPI jar for your Minecraft and Forge version.

2
Install

Place the jar in the mods folder.

3
Launch

Start the game or server once to generate config/droprate.config.json.

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

dependencies {
    implementation fg.deobf("curse.maven:drop-rate-api-1208468:6249868")
}

Configuration

The main configuration file is config/droprate.config.json.

{
  "config": [
    {
      "mob": "minecraft:zombie",
      "rate": 80,
      "item": ["minecraft:apple"],
      "item_amount": {
        "min_amount": 1,
        "max_amount": 3
      }
    }
  ]
}
FieldTypeDescription
mobStringEntity ID such as minecraft:zombie.
rateIntegerDrop chance percentage from 0 to 100.
itemArrayItem IDs to drop.
item_amountNumber or ObjectFixed amount or min_amount/max_amount range. Amounts are clamped from 1 to 64.

Commands

CommandDescription
/droprate_reloadReloads config/droprate.config.json without restarting.

Developer API

import th.tamkungz.droprateapi.api.DropRateAPI;
import net.minecraft.entity.EntityType;
import net.minecraft.item.Items;
import java.util.Arrays;

DropRateAPI.registerDrop(
    EntityType.ZOMBIE,
    75,
    Arrays.asList(Items.DIAMOND, Items.EMERALD),
    1,
    5
);

DropRateAPI.removeDrop(EntityType.CREEPER, Items.GUNPOWDER);

Compatibility

Load order

Load DropRateAPI after core content mods when possible, and before heavy loot modifiers when you need its rules to win.

License

Check the project source or release page for the current license terms.