======Add Item To Container====== ---- Adds one or more of the specified [[item|item]] to an [[item_container|item container]]. The ID of the [[item|item]] is case-sensitive and should match the ID assigned to it in the [[item_editor|Item Editor]] (e.g. "ITEM_0001"). The [[item|item(s)]] will be placed into the first open slot(s) of the [[item_container|container]]. ====Signature:==== add_item_to_container(entity, item_id, count) ^Argument^Description^Type^Required^ |entity|Container [[entity|entity]] to which the [[item|item]] will be added.|[[entity|Entity]]|Yes| |item_id|ID of the [[item|item]] (as assigned in the [[item_editor|Item Editor]]).|[[string|String]]|Yes| |count|How many of the [[item|item]] to add (defaults to 1).|[[number|Number]]|No| ^Return Value^Description^Type^ |Number Added|Returns the actual number of [[item|items]] that were added to the [[item container]]. This could be less than the count supplied to the function, for example if the [[item container]] becomes full.|[[Number]]| ====Example:==== add_item_to_container(self, "ITEM_0001", 1); //Results:// One of ITEM_0001 is placed into the [[item_container|container]] [[entity|entity]] from which the [[script|script]] was triggered. Use the **Add Item Container** function to place a new [[item|item]] into a chest or onto a table after the player has performed an action to build, generate, or "craft" the [[item|item]]. ---- ====Editor Node:==== {{:add_item_to_container_node.png?nolink|}} ====Visual Demo:==== {{:add_item_to_container_demo.gif?nolink|}} ~~NOTOC~~