-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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. And 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 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 :)