User Tools

Site Tools


actions:action_types:modify_item

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
actions:action_types:modify_item [2024/04/30 18:44] – created errorcraftactions:action_types:modify_item [2024/05/15 13:01] (current) – fix loot context type link errorcraft
Line 1: Line 1:
 ====== minecraft:modify_item ====== ====== minecraft:modify_item ======
 The ''minecraft:modify_item'' action type modifies an item stack. The ''minecraft:modify_item'' action type modifies an item stack.
-The action is unsuccessful if no item stack is supplied to the action contextor if the supplied item stack is empty. +The action is unsuccessful if no item stack is supplied to the action context or if the supplied item stack is empty. 
-Otherwise it's successful, regardless of the changes made to the item stack.+In all other cases it's successful, regardless of the changes made to the item stack.
  
  
 ===== Fields ===== ===== Fields =====
 ^  Name  ^  Description  ^  Type  ^  Default Value  ^ ^  Name  ^  Description  ^  Type  ^  Default Value  ^
-| ''item_modifier'' | The [[mc>Item_modifier|item modifier]] to apply. Note that it uses the [[extras:loot_tables:loot_types:action]] [[mc>Loot_table#Loot_context_types|loot context type]]. | An [[mc>Item_modifier|item modifier]] | | +| ''item_modifier'' | The [[mc>Item_modifier|item modifier]] to apply. Note that it uses the [[extras:loot_tables:loot_context_types:action]] [[mc>Loot_context|loot context type]]. | An [[mc>Item_modifier|item modifier]] | | 
-| ''context'' | The context to use for applying the item modifier. | An [[actions:action_contexts|action context parameter set]] | |+| ''context'' | The context to use for applying the item modifier. | An [[actions:action_contexts#parameter_sets|action context parameter set]] | |
  
  
Line 14: Line 14:
 <code javascript> <code javascript>
 { {
-  "action":+  "type": "minecraft:modify_item", 
-    "type": "minecraft:modify_item", +  "item_modifier":
-    "item_modifier":+    "function": "minecraft:set_count", 
-      "function": "minecraft:set_count", +    "count":
-      "count":+  }, 
-    }, +  "context":
-    "context":+    "entity": "this", 
-      "entity": "this", +    "position": "this"
-      "position": "this" +
-    }+
   }   }
 } }
 </code> </code>
actions/action_types/modify_item.1714502685.txt.gz · Last modified: 2024/04/30 18:44 by errorcraft