Skip to content
Tyler Hancock edited this page May 25, 2020 · 7 revisions

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.

Content

Recipe Types

Recipe types allow different characteristics to be applied to a recipe.

Shaped Damage 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
  }
}

Shapeless Damage Recipe

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

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.

Mod ID

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"
}

Any Hoe

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"
}

Any Pickaxe

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"
}

Any Axe

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"
}

Any Shovel

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"
}

Any Sword

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

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.

Check Biome Tag

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"
}

Check Dimension

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"
}

Check For Village

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"
}

Check For Raid

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"
}

Check For Slime Chunk

Only In: 5.2.5+
This condition checks if the loot is being generated within a slime chunk.

Example:

{
  "condition": "bookshelf:slime_chunk"
}

Check For Structure

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"
}

Check Redstone Power

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

Global loot modifiers are a Minecraft Forge mechanic which allow for the results of any loot table to be modified under specific conditions.

Clear Items

Only In: 5.2.5+
This modifier will completely remove all drops from the table.

example

{
  "type": "bookshelf:clear",
  "conditions": []
}

Apply Silk Touch

Only In: 5.2.5+
This modifier will apply silk touch if it did not already exist.

example

{
  "type": "bookshelf:silk_touch",
  "conditions": []
}

Convert To Different Table

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": []
}

Item Predicates

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.

Mod Id Predicate

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"
}

Ingredient Predicate

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"
  }
}