User Tools

Site Tools


add_item_to_container

This is an old revision of the document!


Add Item To Container


Adds one or more of the specified item to an item container. The ID of the item is case-sensitive and should match the ID assigned to it in the Item Editor (e.g. “ITEM_0001”). The item will be placed into the first open slot of the player's inventory.

Signature:

add_item_to_container(entity_id, item_id, count)
ArgumentDescriptionTypeRequired
entity_idEntity ID of the container to add the item to.StringYes
item_idID of the item (as assigned in the Item Editor).StringYes
countNumber of the item to add (defaults to 1).NumberNo

Example:

add_item_to_container("wooden_chest", "ITEM_0001", 2)

Results: Two of ITEM_0001 are placed into the “wooden_chest” container entity.

Use the Add Item Container function to …


Editor Node:

Visual Demo:

add_item_to_container.1577056910.txt.gz · Last modified: 2019/12/22 15:21 by justin