For example, to summon an invisible armor stand with the "hello" tag and a pumpkin on his head, you would do the following command:
For example, to summon an armor stand with a given rotation, you need to specify that the values are floats.
With this command, you get the expected result:
Omit the unit, and the armor stand rotation will be wrong:
To specify a unit, you must call the corresponding method under the
NBT object. For all units, there are 2 possible calls:
- With a single number. It will add the given unit to the number.
- With an array of numbers. It will add the given unit to all numbers in the array.
For example, to summon an armor stand with
Invisible: 1b and
Rotation: [90f, 0f], you must write:
Here is a summary of all units and their corresponding methods.
Integer array and Long array are different from arrays of integers and arrays of longs. These types were added recently, and are use in a few specific places. They are represented this way:
Long arrays are used to store chunk data.
Another syntax exists. It's more compact, easier to read, but has absolutely no type safety and no validation. It uses the template string syntax:
Please note than no validation is performed. For example, missing a bracket will result in an invalid command.
The above snippet results in the following invalid command: