# SetContainerItems

TIP

  • setContainerItems(<world>, <x>, <y>, <z>, <items>)
  • Sets the items of a container block, <items> must be an array with the format of:
[<slot> => [
  "custom_name" => <custom_name>  (Optional)
  "id"          => <id>
  "meta"        => <meta>         (Optional)
  "amount"      => <amount>       (Optional)
  "nbt"         => <nbt>          (Optional)
  ],
. . .
]

# Parameters

  • <world> The world the block is in as string
  • <x> The X coordinate for the block as int or float
  • <y> The Y coordinate for the block as int or float
  • <z> The Z coordinate for the block as int or float
  • <items> The items to set to the block as array

# Example

1: $items$ = array(1 => array('id' => 5), 3 => array('id' => 5, 'meta' => 2))
2: setContainerItems('world', 1025, 67, 942, $items$)