Modify
Applies an item modifier to the item stack.
Type ID: eggolib:modify
Note
This item action type has the following loot context:
- The origin position of the item modifier; X: 0, Y: 0 and Z: 0 by default.
this
entity; the holder of the item stack.- The block of the item modifier; at the origin position of the item modifier.
- The block entity of the item modifier; at the origin position of the item modifier.
Fields
Field | Type | Default | Description |
---|---|---|---|
modifier |
Identifier | The item modifier to apply to the item stack. | |
position |
Vector | {"x": 0, "y": 0, "z": 0} |
If specified, this position will be used for the origin position of the item modifier. |
dimension |
Identifier | minecraft:overworld |
If specified, this dimension will be used for the origin position of the item modifier. |
Examples
data/example/item_modifiers/smelt.json
This example will apply the example:smelt
item modifier to the item stack, smelting the item stack as if it was smelted in a Furnace.
"item_action": {
"type": "eggolib:modify",
"modifier": "example:copy_from_block",
"position": {
"x": -30000000,
"y": 0,
"z": 1602
}
}
data/example/item_modifiers/copy_from_block.json
{
"function": "minecraft:copy_nbt",
"source": "block_entity",
"ops": [
{
"source": "Items",
"target": "BlockEntityTag.Items",
"op": "replace"
}
]
}
This example will copy the items from the block container at -30000000 0 1602 in the Overworld to the item stack.