Repository navigation
Customizing the Mod
MobMarket allows complete server-side control over your economy, mob drops, and dynamic pricing scaling through custom data packs.
Currencies are defined using JSON files placed inside your data pack under the data/mobmarket/currencies/ directory. Each file establishes a currency type, its display names, and the item values associated with it.
{
"singular_name": "emerald",
"plural_name": "emeralds",
"items": {
"minecraft:emerald": 1,
"minecraft:emerald_block": 9
}
}Parameters:
- singular_name: The display name for a single unit (e.g., "emerald").
- plural_name: The display name for multiple units (e.g., "emeralds").
- items: Maps item registry IDs to their numeric currency value.
Mob pricing and rules are structured under folder-mapped JSON files located in your data pack under data/mobmarket/prices/<mod_id>/<entity_name>.json.
{
"currency_id": "emerald",
"base_price": 8,
"allow_babies": true,
"modifiers": [
{
"key": "generic.max_health",
"type": "linear",
"baseline": 20.0,
"multiplier_per_unit": 0.05,
"min_multiplier": 0.1,
"max_multiplier": 10.0
}
]
}Parameters:
- currency_id: The target currency paid out when trading this mob.
- base_price: The baseline payout value for the entity.
- allow_babies: (Optional) Determines whether baby mob variants can be traded. Can be set globally in the config.
- modifiers: (Optional) Dynamic scaling rules that adjust prices based on entity attributes (like health) or custom NBT values using scaling types like "linear", "flat", or "exponential".
MobMarket supports dynamic price scaling based on entity attributes and custom NBT values. You can define these rules inside your mob pricing JSON files under the modifiers array.
Each modifier specifies a type that determines how entity stats translate into bonus currency value:
Scales the price proportionally based on the difference between the entity's current value and a defined baseline.
-
Formula:
currentPrice * clamp(1.0 + ((rawValue - baseline) * multiplierPerUnit), minMultiplier, maxMultiplier) - Use Case: Scaling health or damage where every point above a baseline adds a steady percentage increase.
Adds a flat bonus amount to the price if the entity meets a specific numerical threshold.
-
Formula: If
rawValue >= threshold, addbonusAmountto the price. - Use Case: Flat-rate bounties for boss-tier health pools or elite entities.
Scales the price exponentially once the entity's value exceeds the baseline.
-
Formula:
currentPrice * clamp((rawValue / baseline) ^ multiplierPerUnit, minMultiplier, maxMultiplier) - Use Case: Exponential scaling for extremely high-tier stats or custom attributes.
Checks if the entity's attribute or NBT value precisely matches a target threshold (within a tiny tolerance of 0.0001).
-
Formula: If
rawValue == threshold, addbonusAmount. - Use Case: Triggering unique flat bonuses for exact milestone values.
If you want to reward players extra currency for trading specific animal breeds or variants (such as a horse with a specific breed tag ID), you can use the match rule:
{
"currency_id": "emerald",
"base_price": 50.0,
"allow_babies": false,
"modifiers": [
{
"key": "Breed",
"type": "match",
"threshold": 22.0,
"bonus_amount": 100
}
]
}When writing a modifier inside your pricing files, you can configure the following properties:
| Property | Type | Description |
|---|---|---|
key |
String | The attribute registry ID (e.g., "generic.max_health") or an NBT tag key to search for on the entity. |
type |
String | The scaling calculation type: "linear", "flat", "exponential", or "match". |
baseline |
Double | The starting value benchmark used for calculations in linear and exponential scaling. |
multiplier_per_unit |
Double | The scaling weight applied per unit change past the baseline. |
threshold |
Double | The target value required to trigger flat or match bonuses. |
bonus_amount |
Integer | The flat bonus currency added when a flat or match condition is met. |
min_multiplier |
Double | The floor limit for scaling multipliers (defaults to 0.1). |
max_multiplier |
Double | The ceiling limit for scaling multipliers (defaults to 10.0). |