Skip to content
SammySemicolon edited this page Dec 23, 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 create 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.

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 an example of that:

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

That's all, enjoy your block rummaging :)

Clone this wiki locally