Dropt Mod — Guide
Mechanics
Dropt operates through a hierarchy of Rules, Matchers, and Drops. When a block is broken, the mod scans its cached rules to find a match. If a match is found, the specified replacement strategy is executed.
Replacement Strategies
These strategies determine how Dropt interacts with the block's original loot table:
| Strategy | Description |
|---|---|
ADD |
Adds the new drops to the existing block drops. |
REPLACE_ALL |
Removes all original drops and replaces them with the new ones. |
REPLACE_ALL_IF_SELECTED |
Only replaces original drops if one of the new drops is successfully selected. |
REPLACE_ITEMS |
Replaces only the items defined in the match criteria. |
REPLACE_ITEMS_IF_SELECTED |
Replaces matched items only if a new drop is selected. |
Drop Strategies
When multiple drops are defined in a rule, these strategies control selection:
- REPEAT: Allows the same drop to be selected multiple times (default).
- UNIQUE: Ensures each drop in the list can only be selected once per block break.
Rule Matching
Rules are triggered based on a match object. This object can contain several criteria that must all be met for the rule to apply.
Match Criteria
- Blocks: A list of block strings (e.g.,
minecraft:stone:0). Supports whitelisting and blacklisting. - Items: Matches based on the items the block would have dropped. Supports Ore Dictionary entries.
- Biomes & Dimensions: Restrict rules to specific environments using registry names or ID numbers.
- Vertical Range: Define a minimum and maximum Y-level (e.g., only drops emeralds below Y=16).
- Harvester:
- Type:
PLAYER,NON_PLAYER,REAL_PLAYER,FAKE_PLAYER,EXPLOSION, orANY. - Player Name: Whitelist specific players.
- Held Item: Matches items in the main hand or off-hand, including metadata and NBT.
- Game Stages: Requires the GameStages mod. Can require
ALL,ANY, orNONEof the specified stages.
ZenScript Integration
For users of CraftTweaker, Dropt provides a powerful ZenScript API. This allows for dynamic rule creation within .zs files.
Basic Syntax
To use Dropt in ZenScript, you must import the mod's classes:
import mods.dropt.Dropt;
Example Script
This script replaces all drops from Stone with a single Diamond if broken by a player:
Dropt.list("stone_replacement")
.add(Dropt.rule
.matchBlocks(["minecraft:stone"])
.replaceStrategy("REPLACE_ALL")
.addDrop(Dropt.drop
.items([<minecraft:diamond>])
)
);
Advanced Drop Selection
You can define weights and fortune requirements for drops:
.addDrop(Dropt.drop
.items([<minecraft:emerald>])
.selector(Dropt.weight(10), "REQUIRED", 3) // Weight 10, Silk Touch Required, Fortune Level 3
)
Debugging and Logs
Dropt maintains a dedicated log file located at [instance]/dropt.log. This file contains detailed information regarding rule parsing, matching successes, and any errors encountered during runtime.
If a JSON file fails to load, the log will specify the exact line and character where the syntax error occurred. By default, Dropt uses strict JSON parsing; if an unknown field is detected, the rule list will fail to load to prevent unexpected behavior.