Skip to content
SammySemicolon edited this page Dec 26, 2022 · 9 revisions

Here's a quick guide on how to use the "Rummage Through Blocks - Pebbles Not Included"! mod.

To begin, create a datapack and make a data/mod_id/rummaging directory. If you're not sure what to set the mod id to, just use block_rummage. Next, create a json file to store your rummaging entry. It should contain the following:

  • id - the internal id which will be used to reference the entry.

  • target - an ingredient which will be used as a target for this rummaging entry.

  • held_item_data - a json object which is used to determine what the player needs to be holding in order to rummage through blocks. The object must contain a type string, which needs to be set to one of the following:

  • block_rummage:empty_hand - Players may only rummage through the block if their hand is empty.

  • block_rummage:matching_ingredient - Players must be holding a matching ingredient in their hand to rummage through the block. Specify the ingredient as ingredient

  • block_rummage:has_tool_action - Players must be holding an item which can perform a forge tool action in order to rummage through the block. Specify the tool action as tool_action

You may also specify a durability_cost which will damage the item on successful and unsuccessful block rummaging. You can't damage your hand though. When dealing with block_rummage:matching_ingredient you may also specify consume_item as true. This will instead use durability cost as an amount to reduce the held item's quantity by.

  • result - a json array containing all of the loot entries which which the player will be able to dig up. Each entry must specify an output ingredient, an amount integer, and a chance float.

Here's some examples:

{
  "id": "block_rummage:flint_digging",
  "target": {
    "tag" : "forge:gravel"
  },
  "held_item_data": {
    "type": "block_rummage:has_tool_action",
    "tool_action": "shovel_dig",
    "durability_cost": 1
  },
  "result": [
    {
      "output": {
        "item" : "minecraft:flint"
      },
      "chance" : 1.0,
      "amount": 1
    },
    {
      "output": {
        "item" : "minecraft:flint"
      },
      "chance" : 0.2,
      "amount": 1
    }
  ]
}
{
  "id": "block_rummage:bonemealing",
  "target": {
    "tag" : "forge:dirt"
  },
  "held_item_data": {
    "type": "block_rummage:matching_ingredient",
    "target": {
      "item" : "minecraft:bonemeal"
    },
    "durability_cost": 1,
    "consume_item": true
  },
  "result": [
    {
      "output": {
        "item" : "minecraft:seeds"
      },
      "chance" : 0.5,
      "amount": 1
    }
  ]
}

Here's a quick list of valid tool actions:

  • forge:axe_dig
  • forge:pickaxe_dig
  • forge:shovel_dig
  • forge:hoe_dig
  • forge:sword_dig
  • forge:shears_dig
  • forge:axe_strip
  • forge:axe_scrape
  • forge:axe_wax_off
  • forge:shovel_flatten
  • forge:sword_sweep
  • forge:shears_harvest
  • forge:shears_carve
  • forge:shears_disarm
  • forge:till
  • forge:shield_block
  • forge:fishing_rod_cast

That's all, enjoy your block rummaging :)

Clone this wiki locally