Trade Data

The villager trade customization component is reused across several JSON files within Resourceful Bees. It is responsible for defining the costs and rewards of certain trade items depending on which file it is used in. Not including a villager trade customization component prevents the associated items from being added to the pool of trades.

Below are the JSON files which can have a villager trade customization component and the trades they create.

When the component is used in a custom bee JSON, a filled bee jar will be added to the Level 5 trade pool.

Adding an empty villager trade component will add the trade to the pool using all default values.

Example
{
  "resourcefulbees:block/v1": {
    "color": "rainbow",
    "honeyBlockItem": "resourcefulbees:rainbow_honey_block",
    "honeyBlock": "resourcefulbees:rainbow_honey_block",
    "tradeData": {}
  }
}
Template:
"resourcefulbees:trade/v1": {
  "amount": {
    "min": 1,
    "max": 1
  },
  "secondaryItem": "minecraft:coal_block",
  "secondaryItemCost": {
    "min": 4,
    "max": 8
  },
  "priceMultiplier": 0.4,
  "maxTrades": 2,
  "xp": 8
}

Identifier


The root JSON of the villager trade customization component looks like this:

"resourcefulbees:trade/v1": {
    ...
}

The identifier of the component is as such:

resourcefulbees:trade/v1

In custom honeycomb and honey JSON's the identifier is tradeData:

Example
{
  "resourcefulbees:block/v1": {
    "tradeData": {}    <---- Identifier
  }
}

Customization Options


amount

The max amount of filled bee jars that can potentially be received in a single trade.

When trades are being populated, the amount actually used is a randomized value between the min and the max, therefore, not all trades will always have this amount.


Name: Amount

Key: amount

Type: UniformInt

Default: 1, 64

Example
"resourcefulbees:trade/v1": {
  "amount": {
    "min": 1,
    "max": 1
  }
}

secondaryItem

The item needed, when the trade requires a secondary item, in addition to golden flowers.


Name: Secondary Item

Key: secondaryItem

Type: ItemStack

Default: ItemStack.EMPTY

Example
"resourcefulbees:trade/v1": {
  "secondaryItem": "minecraft:coal_block"
}

secondaryItemCost

The max base cost for the secondary item.

When trades are being populated, the amount actually used is a randomized value between the min and the max, therefore, not all trades will always have this amount.


Name: Secondary Item Cost

Key: secondaryItemCost

Type: UniformInt

Default: 1, 4

Example
"resourcefulbees:trade/v1": {
  "secondaryItem": "minecraft:coal_block",
  "secondaryItemCost": {
    "min": 4,
    "max": 8
  }
}

priceMultiplier

When demand goes up, so does the price. Use this value to scale the price increase.

Most vanilla trades have a price multiplier of 0.05


Name: Price Multiplier

Key: priceMultiplier

Type: Float

Range: 0.00 - 1.00

Default: 0.05

Example
"resourcefulbees:trade/v1": {
  "priceMultiplier": 0.4
}

maxTrades

The max number of trades that can be performed before a restock is needed.


Name: Max Trades

Key: maxTrades

Type: Integer

Range: 1 - 64

Default: 8

Example
"resourcefulbees:trade/v1": {
  "maxTrades": 2
}

xp

The XP awarded each trade.


Name: XP

Key: xp

Type: Integer

Range: 1 - 64

Default: 3

Example
"resourcefulbees:trade/v1": {
  "xp": 8
}

Last updated