-
Notifications
You must be signed in to change notification settings - Fork 39
Data Packs
Bookshelf greatly expands the data pack specification with many new features. Any mod, modpack, datapack, server, or world file may use these expanded features as long as Bookshelf is installed on the client and server.
Recipe types allow different characteristics to be applied to a recipe.
Only in: 5.6.37+
This recipe type is an extension of the shaped crafting recipe which does durability damage to damageable inputs rather than completely consuming them. If an item has the Unbreakable NBT tag it will be accepted but won't be damaged or consumed.
The format for this recipe is the same as the vanilla shaped recipe however there are two optional values.
-
damageAmount
- The amount of durability damage to do to input items. The default is 1 if this is not specified. -
ignoreUnbreaking
- Whether or not the recipe should ignore the unbreaking enchantment. The default is false if this is not specified.
{
"type": "bookshelf:crafting_shaped_with_damage",
"damageAmount": 8,
"ignoreUnbreaking": false,
"pattern": [
"DDD",
"DHD",
"DDD"
],
"key": {
"D": {
"item": "minecraft:dirt"
},
"H": {
"item": "minecraft:iron_hoe"
}
},
"result": {
"item": "minecraft:farmland",
"count": 8
}
}
Only in: 5.6.37+
This recipe type is an extension of the shapeless crafting recipe which does durability damage to damageable inputs rather than completely consuming them. If an item has the Unbreakable NBT tag it will be accepted but won't be damaged or consumed.
The format for this recipe is the same as the vanilla shapeless recipe however there are two optional values.
-
damageAmount
- The amount of durability damage to do to input items. The default is 1 if this is not specified. -
ignoreUnbreaking
- Whether or not the recipe should ignore the unbreaking enchantment. The default is false if this is not specified.
{
"type": "bookshelf:crafting_shapeless_with_damage",
"damageAmount": 2,
"ignoreUnbreaking": false,
"ingredients": [
{
"item": "minecraft:iron_sword"
},
{
"item": "minecraft:bread"
}
],
"result": {
"item": "minecraft:wheat",
"count": 3
}
}
Ingredients are used to check if an input item matches a set of given conditions. These are typically used for recipe inputs however other systems and mods may use them as well.
Only in: 5.6.39+ This ingredient can be used to accept any item from a specific mod. This is done by checking the namespace of the item and comparing it against the provided modid. The namespace is the text before the colon character in the item ID.
{
"type": "bookshelf:modid",
"modid": "darkutils"
}
Only in: 5.6.37+
This ingredient can be used as a stand in for any hoe item. It will check if the item is defined as a hoe in the code. If it is not a fallback check for the forge:hoes
or forge:tools/hoes
item tag will be done.
{
"type": "bookshelf:any_hoe"
}
Only in: 5.6.37+
This ingredient can be used as a stand in for any pickaxe item. It will check if the item is defined as a pickaxe in the code. If it is not a fallback check for the forge:pickaxes
or forge:tools/pickaxes
item tag will be done.
{
"type": "bookshelf:any_pickaxe"
}
Only in: 5.6.37+
This ingredient can be used as a stand in for any axe item. It will check if the item is defined as an axe in the code. If it is not a fallback check for the forge:axes
or forge:tools/axes
item tag will be done.
{
"type": "bookshelf:any_axe"
}
Only in: 5.6.37+
This ingredient can be used as a stand in for any shovel item. It will check if the item is defined as a shovel in the code. If it is not a fallback check for the forge:shovels
or forge:tools/shovels
item tag will be done.
{
"type": "bookshelf:any_shovel"
}
Only in: 5.6.37+
This ingredient can be used as a stand in for any sword item. It will check if the item is defined as a sword in the code. If it is not a fallback check for the forge:swords
or forge:tools/swords
item tag will be done.
{
"type": "bookshelf:any_sword"
}
Loot conditions are used to check if something can happen within a specific game context. They are primarily used for loot tables however they are also sometimes used in situations which have nothing to do with loot.
Only In: 5.2.5+
This condition checks if the loot is being generated within a biome that has a specified biome dictionary tag. Biome tags are defined by MinecraftForge and are generally all upper cased strings.
This is a list of all the biome tags included with Forge by default.
SNOWY, BEACH, SAVANNA, MESA, RARE, SPOOKY, WET, SPARSE, MOUNTAIN, DRY, RIVER, MAGICAL, NETHER, WATER, DENSE, JUNGLE, SANDY, OCEAN, HILLS, HOT, FOREST, MUSHROOM, OVERWORLD, PLATEAU, PLAINS, SWAMP, END, COLD, DEAD, MODIFIED, VOID, LUSH, CONIFEROUS, WASTELAND
Example:
{
"condition": "bookshelf:check_biome_tag",
"tag": "OCEAN"
}
Only In: 5.2.5+
This condition checks if the loot is being generated within a given dimension.
Example:
{
"condition": "bookshelf:check_dimension",
"dimension": "minecraft:the_nether"
}
Only In: 5.2.5+
This condition checks if the loot is being generated within the bounds of a village.
Example:
{
"condition": "bookshelf:check_village"
}
Only In: 5.2.5+
This condition checks if the loot is being generated within the bounds of an active raid.
Example:
{
"condition": "bookshelf:check_raid"
}
Only In: 5.2.5+
This condition checks if the loot is being generated within a slime chunk.
Example:
{
"condition": "bookshelf:slime_chunk"
}
Only In: 5.2.5+
This condition checks if the loot is being generated within the bounds of a structure. Vanilla structure names tend to be all lower case. Modded structures tend to be prefixed with the mod id.
This is a list of all vanilla structure names.
mansion, desert_pyramid, buried_treasure, igloo, stronghold, monument, pillager_outpost, fortress, shipwreck, swamp_hut, village, endcity, ocean_ruin, mineshaft, jungle_pyramid
Example:
{
"condition": "bookshelf:check_structure",
"structure": "desert_pyramid"
}
Only In: 5.2.5+
This condition allows you to check if the position the loot ie being generated at has been powered by redstone. An optional min and max value can be specified to limit the range of signal strengths accepted. The default range is 1 to 15 and is an inclusive range.
Example: If Redstone Power is exactly 5
{
"condition": "bookshelf:check_redstone_power",
"value": 5
}
Example 2: Redstone Power is 5 or greater
{
"condition": "bookshelf:check_redstone_power",
"value": {
"min": 5
}
}
Example 3: Redstone Power is 5 or lower
{
"condition": "bookshelf:check_redstone_power",
"value": {
"max": 5
}
}
Example 4: Redstone Power is between 5 and 10
{
"condition": "bookshelf:check_redstone_power",
"value": {
"min": 5,
"max": 10
}
}
Global loot modifiers are a Minecraft Forge mechanic which allow for the results of any loot table to be modified under specific conditions.
Only In: 5.2.5+
This modifier will completely remove all drops from the table.
example
{
"type": "bookshelf:clear",
"conditions": []
}
Only In: 5.2.5+
This modifier will apply silk touch if it did not already exist.
example
{
"type": "bookshelf:silk_touch",
"conditions": []
}
Only In: 5.2.5+
This modifier will convert each item dropped into the result of another loot table.
example
{
"type": "bookshelf:convert",
"table": "minecraft:chests/simple_dungeon",
"chance": 0.05,
"conditions": []
}
An item predicate will check if an item matches a given set of conditions. While these are functionally similar to Ingredients they are completely distinct systems. Minecraft and mods use these in various systems throughout data packs such as the inventory change advancement trigger.
Only In: 5.6.40 This item predicate checks if the item is from a given mod by comparing it's registry name against the specified modid.
{
"type": "bookshelf:modid",
"modid": "minecraft"
}
Only In: 5.6.40 This predicate will compare the item against any ingredient. This allows for the entire ingredient specification to be used in any item predicate.
{
"type": "bookshelf:ingredient",
"ingredient": {
"type": "bookshelf:any_hoe"
}
}
Like the mod? Consider supporting the development of this mod and many others by supporting me on Patreon.