Table of Contents

minecraft:modify_item

The minecraft:modify_item action type modifies an item stack. The action is unsuccessful if no item stack is supplied to the action context or if the supplied item stack is empty. In all other cases it's successful, regardless of the changes made to the item stack.

Fields

Name Description Type Default Value
item_modifier The item modifier to apply. Note that it uses the minecraft:action loot context type. An item modifier
context The context to use for applying the item modifier. An action context parameter set

Example

{
  "type": "minecraft:modify_item",
  "item_modifier": {
    "function": "minecraft:set_count",
    "count": 1
  },
  "context": {
    "entity": "this",
    "position": "this"
  }
}