c0de 0.3.0Diese Seite auf Deutsch

GET_INVENTORY ​

Reads the inventory of a block, such as a chest.

You get one ITEM_STACK (id, count) per slot. An empty slot has the id "" and the count 0. A block without inventory raises INVALID_ARGUMENT.

Parameters and results

  • position STRUCT c0de/minecraft/POSITION: where the block is
  • result result ARRAY STRUCT c0de/minecraft/ITEM_STACK: the slots

Example

c0de
CALL c0de/minecraft/GET_INVENTORY
    PARAMETER position chest ;
    RESULT result slots