inventory.add

Section: Inventory

What it does

inventory.add acts on inventory: it adds. It takes id, quantity and data. quantity and data are optional.

The API says: returns false if full

Signature

inventory.add(id, quantity?, data?)

Arguments

  • id
  • quantityoptional
  • dataoptional

Example · generated

function start() {  inventory.add('main');}

inventory.add is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.

18 members in inventory