Customization
Data Pack
Farming for Blockheads loads data packs to populate its market. For information on how to create a data pack, read through the tutorial on the Minecraft wiki. After adding the data pack to your world, don't forget to enable it using /datapack enable <datapack name>
!
The following example adds a new category for enchanted books, a market entry for selling books with a Wind Burst enchantment, and a defaults key to allow for easy overrides of payments.
If you're re-using existing categories or defaults, all you really need is the pack.mcmeta
file and the recipe file to add an entry to the market.
{
"type": "farmingforblockheads:market",
"defaults": "selling.enchanted_books",
"result": {
"item": "minecraft:enchanted_book",
"components": {
"minecraft:stored_enchantments": {
"levels": { "minecraft:wind_burst": 3 }
},
"minecraft:custom_name": "[{\"translate\": \"enchantment.minecraft.wind_burst\"}, {\"text\": \" 3\"}]"
}
}
}
Defaults
Defaults are managed in a datapack's farmingforblockheads/defaults.json
or the config/farmingforblockheads/defaults.json
file in your config folder.
They are hierarchical going from generic to specific. For example, on a market recipe that defines defaults
to be selling.seeds.farmersdelight
:
- If
defaults.json
defines a default forselling.seeds.farmersdelight
, that will be used. - Otherwise, if
defaults.json
defines a default forselling.seeds
, that will be used. - Otherwise, it will fall back to the
selling
key that comes shipped with Farming for Blockheads (cost: 1 emerald)
Market Categories
Each Market Category adds a new tab to the Market menu. You can add your own categories by creating a data pack.
Market Categories are stored in a folder called market_categories
and behave like any other data resource, i.e. they are namespaced and must be referenced as such.
Farming for Blockheads ships with four default categories: farmingforblockheads:seeds
, farmingforblockheads:saplings
, farmingforblockheads:flowers
and farmingforblockheads:other
.
Example:
{
"tooltip": {
"translate": "category.farmingforblockheads.flowers"
},
"icon": {
"item": "minecraft:dandelion"
},
"sortIndex": 30
}
Market Items
Market Items are the items that are available for purchase in the Market. You can add your own purchaseable items by creating a data pack.
As these items are defined using Minecraft's recipe system, you can also easily use a mod like CraftTweaker to define them via CraftTweaker's addJsonRecipe()
.
Example:
{
"type": "farmingforblockheads:market",
"defaults": "selling.spawn_eggs.minecraft",
"result": {
"item": "minecraft:cat_spawn_egg"
}
}
It will look up the payment and category from the specified defaults
key.
You can also specify these fields directly, but that is not recommended for most cases as it will make it more difficult for others to override these fields.
NBT / Components and Enchanted Items
{
"type": "farmingforblockheads:market",
"result": {
"item": "minecraft:enchanted_book",
"components": {
"minecraft:stored_enchantments": {
"levels": { "minecraft:wind_burst": 3 }
},
"minecraft:custom_name": "[{\"translate\": \"enchantment.minecraft.wind_burst\"}, {\"text\": \" 3\"}]"
}
}
}