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 category for enchanted books, a market entry, and a preset that lets users override the payment. If you reuse existing categories or presets, you only need the pack.mcmeta and recipe files.
{
"type": "farmingforblockheads:market",
"preset": "yourdatapack:enchanted_books",
"category": "yourdatapack: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\"}]"
}
}
}
Market Presets
Market Presets are somewhat comparable to data packs - they control whether a set of Market Items should be available, and control their default payments.
Farming for Blockheads ships with a set of market presets for various supported mods, some of which are disabled by default.
You can enable additional presets or disable default presets in the config file.
Creating your own Market Presets
If you're creating a data pack, it's a good idea to bundle a market preset with it so that users can easily override payment items for your whole set of items.
Market Presets are stored in a folder called market_presets and behave like any other data resource, i.e. they are namespaced and must be referenced as such.
For mod compatibility packs, the namespace should be the mod id, while the path should describe the content of the presets, e.g. minecraft:animal_eggs.
Example:
{
"enabled": true,
"payment": {
"ingredient": {
"item": "minecraft:diamond"
},
"count": 1
}
}
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": {
"id": "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",
"category": "farmingforblockheads:other",
"preset": "minecraft:animal_eggs",
"result": {
"item": "minecraft:cat_spawn_egg"
}
}
The preset supplies the default payment, while category selects the Market tab. Both fields can be specified directly when a preset is not appropriate.
Item Components
{
"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\"}]"
}
}
}