Skip to content
Azagwen edited this page Jun 25, 2021 · 2 revisions

Datapack Item Operations Wiki

Welcome to the wiki, here you can find some informations on how the mod works and can be used to create your own item operations using Datapacks!

Some of the stuff explained here can also be observed in the Example Datapack.

Datapack folder hierarchy

Datapack Item Operations adds a dp_item_ops folder to the data folder present in vanilla and datapacks, from there item operation JSONs are stored in another folder labelled item_operations

JSON structures of Item Operations

For the time being, there is only one type of Item Operation, and that type is dp_item_ops:block_top_block.

dp_item_ops:block_top_block will look for the following arguments :

data_type

data_type is what tells the decoder what type of data will be found in the file, for the time being, this parameter will always be set to dp_item_ops:block_top_block.

"data_type": "dp_item_ops:block_top_block"

item_used and tag_used

item_used and tag_used are JSON objects, they are formatted as follows

"item_used": {
    "item": "item_identifier",
    "damage": 1,
    "decrement": 1
}
"tag_used": {
    "tag": "tag_identifier",
    "damage": 1,
    "decrement": 1
}

damage and decrement are optional parameters, they will specify if the item should be damaged (in the case of a tool) or decremented on use.

targets

targets is where the target blocks are specified, it is formatted as follows

"targets": {
    "target_block_id": {
        "result": "result_block_id",
        "loot": "loot_item_id",
        "sound": "soundevent_id"
    },
    "other_target_block_id": {
        "result": "result_block_id",
        "sound": "soundevent_id"
    },
    "...": {
    }
}

Each target block has a result parameter which is obligatory, and two optional parameters labelled loot and sound.

  • result specifies the block that will replace the target when the operation is executed
  • loot specifies what item will be looted by the block when replaced (i.e roots for rooted dirt)
  • sound specifies what sound event will be played when the operation is executed (i.e minecraft:item.axe.strip for logs)