Parameter Types
Contents
- int
- int32
- int64
- decimal
- float
- number
- extendedNumber
- nonNaNNumber
- nonNaNExtendedNumber
- BigInt
- boolean
- string
- JSON
- JSONArray
- JSONObject
- JSONString
- JSONNumber
- JSONBoolean
- text
- escapableString
- target
- targetSelector
- itemId
- blockId
- Block
- Item
- BlockPattern
- Mask
- SingleBlockMask
- BlockType
- block states
- x y z
- location
- ~
- Dimension
- RGBA
- RRGGBBAA
- RGB
- RRGGBB
- {<string>}
- (<parameterType>|<parameterType>)
int
An integer. (Same support range as "int32")
int32
A 32-bit integer. (Supports -2^31 to 2^31-1)
int64
A 64-bit integer. (Supports -2^63 to 2^63-1)
decimal
A decimal. (128 bit numbers in the form of 12.34
, stored internally in base 10)
float
A float. (32 bit numbers in the form of 12.34
, stored internally in base 2)
number
A float, decimal, integer, Infinity
, -Infinity
, or NaN
.
extendedNumber
A BigInt, float, decimal, integer, Infinity
, -Infinity
, or NaN
.
nonNaNNumber
A float, decimal, integer, Infinity
, or -Infinity
.
nonNaNExtendedNumber
A BigInt float, decimal, integer, Infinity
, or -Infinity
.
BigInt
A BigInt. (Supports large numbers and is specified by appending n
to the value, like 5n
or 19284892917n
)
boolean
A boolean. (true or false, usually required to be lowercase)
string
A string. Can be either a string of text with no spaces, or a JSON formatted string. (ex. "some text\nanother line of text \uE359 and the unicode character U+E359"
or myStringOfText_With-0-Spaces
)
JSON
Stringified JSON.
Some examples include:
1. {"a": 1, "b": "something", "c": true, "d": {"p": 95, "e": -99}, "e": [{"a": 54, "b": true}, [1, "a", true, false], 4, -9, true, false, null], "f": null, "g": -72}
2. true
3. false
4. 57
5. -23
6. "some text\nanother line of text \uE359 and the unicode character U+E359"
7. [1, 4, true, -7, false, "hi", "test", "to", "text\nnext line of text", {"a": 1, "b": 2}, [1, 4, false, "some"]]
JSONArray
A stringified JSON array.
Example: [1, 4, true, -7, false, "hi", "test", "to", "text\nnext line of text", {"a": 1, "b": 2}, [1, 4, false, "some"]]
JSONObject
A stringified JSON object.
Example: {"a": 1, "b": "something", "c": true, "d": {"p": 95, "e": -99}, "e": [{"a": 54, "b": true}, [1, "a", true, false], 4, -9, true, false, null], "f": null, "g": -72}
JSONString
A JSON formatted string. ex. "some text\nanother line of text \uE359 and the unicode character U+E359"
JSONNumber
A decimal, float, or integer.
JSONBoolean
A boolean.
text
A string of text that allows for spaces, does not need quotation marks.
escapableString
A string of text that allows for spaces and JаvaScript escape codes, does not need quotation marks.
target
A target selector.
Examples:
@s
Andexter8
"Evil Steve"
@a[name=Herobrine,tag=test,c=1,rm=0.5,r=5,x=1,y=1,z=1]
@e[family=monster,type=creeper]
targetSelector
The same as target.
itemId
A namespaced id of an item type, for example andexdb:debug_stick
, or minecraft:grass
, or netherreactor
, or stick
.
blockId
A namespaced id of a block type, for example andexsa:diamond_crafting_table
, or minecraft:grass_block
, or glowingobsidian
, or stone
.
Block
The same as blockId. A namespaced id of a block type, for example andexsa:diamond_crafting_table
, or minecraft:grass_block
, or glowingobsidian
, or stone
.
Item
The same as itemId. A namespaced id of an item type, for example andexdb:debug_stick
, or minecraft:grass
, or netherreactor
, or stick
.
BlockPattern
A block pattern.
This parameter type is mainly used to fill areas with patterns.
These patterns are specified by having multiple blocks separated by commas.
Each of the block IDs can have namespaces but if they are vanilla blocks then the namespace is optional (ex. stone
could be minecraft:stone
or stone
, but andexrp:debug
can only be andexrp:debug
not debug
). The block IDs can also have quotes but these are also optional (ex. stone
could be minecraft:stone
, stone
, "minecraft:stone"
, or "stone"
).
Example: diamond_block,iron_block
.
Adding s:
to the start of the list causes the blocks to be placed in a predictable pattern (will be the same each time).
Adding r:
to the start of the list causes the blocks to be placed in a random pattern, this is useless as this is the default behavior, so it is unnecessary to add r:
to the beginning of the block pattern.
In this mode the blocks are placed in the order they are specified, if the weight of a block type is specified in this mode, it will be as if you had typed that block twice in the list, if you want the block type to appear in multiple places in the pattern, you can just specify it multiple times.
Example: s:diamond_block,iron_block
.
Also, adding a %<int>
after each block name to set the ratio in which to spawn (defaults to 1), like diamond_block%20,iron_block
will spawn 20 diamond blocks for each iron block (iron block has a 1/21 = 4.8% weight).
Lastly, adding block states (like you would in a normal command or in JSON syntax) after any block name or weight value will also work, like: andesite_stairs%20["upside_down_bit"=true],granite_stairs%20{"upside_down_bit":true},stone,glass%36
Examples:
diamond_block,iron_block
- Random combination of diamond and iron blocks, each with an equal probability of spawning.s:diamond_block,iron_block
- Sequence that alternates between diamond and iron blocks every block.diamond_block%20,iron_block
- Random combination of diamond and iron blocks, with diamond blocks having a 20/21 (95.2% chance) of spawning, and iron blocks having a 1/21 (4.8% chance) of spawning.andesite_stairs%20["upside_down_bit"=true],granite_stairs%20{"upside_down_bit":true},stone,glass%36
- Random combination of upside down andesite stairs, upside down granite stairs, stone, and glass, with upside down andesite stairs having a 20/77 (26.0% chance) of spawning, upside down granite stairs having a 20/77 (26.0% chance) of spawning, stone having a 1/77 (1.3% chance) of spawning, and glass having a 36/77 (46.7% chance) of spawning.stone,grass_block,ice%1,minecraft:end_gateway%10,andexrp:debug,"minecraft:iron_ore"%50,minecraft:diamond_block,"sandstone","minecraft:sand","packed_ice"%37,polished_blackstone_stairs["upside_down_bit"=false, "weirdo_direction"=4],minecraft:chest["cardinal_direction" = "north"],slime_block,oak_slab{"top_half_bit": true},minecraft:diorite_wall%76{"north_wall_bit": false, "south_wall_bit":true},glass
- A very complicated block pattern.
Examples of INVALID block patterns:
diamond_block, iron_block
- You cannot have spaces in a block pattern unless they are inside of the brackets for block states, or are inside of the block's ID if it is in quotes.diamond_block iron_block
- The block IDs must be separated by commas, not spaces.diamond_block,iron_bl ock
- You must have quotes around the block ID to have spaces in it (ex.diamond_block,"iron_bl ock"
), but even then, the block ID for the vanilla iron block does not have spaces in it so the iron block in the case would be ignored.andesite_stairs%20["upside_down_bit"=true
- The right square bracket is missing.andesite_stairs%20{"upside_down_bit"=true}
- If you use curly brackets for the block states, then you must put them in JSON object format (ex.andesite_stairs%20{"upside_down_bit":true}
).andesite_stairs%20["upside_down_bit":true]
- If you use square brackets for the block states, then you must put them in Minecraft block states format (ex.andesite_stairs%20["upside_down_bit"=true]
).andesite_stairs["upside_down_bit"=true]%20
- The weight must be specified BEFORE the block states not after.%20andesite_stairs["upside_down_bit"=true]
- The weight must be specified AFTER the block ID not before.["upside_down_bit"=true]andesite_stairs%20
- The block states must be specified AFTER the block ID and weight not before.andesite_stairs%20[upside_down_bit=true]
- The property names of the block states must be quoted.
Mask
Instructions: Add some examples.
A block mask.
These are very similar to block patterns, the main difference is that block masks support other kinds of filters, and that block masks do not support weights.
Another major difference is that instead of being able to prefix the block mask with s:
or r:
, like with block patterns, instead you can prefix the block mask with i:
or e:
, to switch between include and exclude mode.
Include mode will cause the block mask to only match blocks that match the mask. For example, i:air,stone
would only match air and stone blocks. This i:
prefix is useless in most situations, as include mode is the default mode, so adding it does nothing. The only time the i:
prefix does anything is if the command that this block mask is being used in defaults to using exclude mode.
Exclude mode basically just inverts the selection, so it will match all blocks that don't match the mask. For example, e:air,stone
would only match blocks that are NOT air or stone blocks.
Features unique to block masks:
- Presets:
- You can specify these presets just like you would specify a regular block type. When you specify a preset, then it will match any of the block types that it includes.
- Here is the current list of valid block presets, and what block types they include:
preset:leaves
: includes all block types that have "leaves" in the name.preset:deforest
: includes all block types that have "leaves" or "sapling" in the name, any block with the "log" or "plant" tags,short_grass
,tall_grass
,vine
,dandelion
,allium
,brown_mushroom_block
,red_mushroom_block
,mushroom_stem
,crimson_roots
,warped_roots
, andbee_nest
. It is still a work in progress and will include more block types in the future.preset:ores
: includes all block types that have "ore" in the name, as well as ancient debris.preset:ore_blocks
: includes the following block types:coal_block
copper_block
exposed_copper
weathered_copper
oxidized_copper
waxed_copper
waxed_exposed_copper
waxed_weathered_copper
waxed_oxidized_copper
iron_block
gold_block
emerald_block
diamond_block
netherite_block
redstone_block
lapis_block
raw_copper_block
raw_iron_block
raw_gold_block
preset:liquid
: includeswater
,flowing_water
,lava
, andflowing_lava
.
- Tags:
- Block masks allow you to filter blocks by block tags. To use a block tag, just put
tag:tagname
as the block type. ex.tag:plant
ortag:minecraft:is_hoe_item_destructable
.
- Block masks allow you to filter blocks by block tags. To use a block tag, just put
SingleBlockMask
BlockType
block states
A set of block states. Ex. ["infiniburn_bit"=false,"cardinal_direction"="north"]
x y z
A set of coordinates, relative coordinates and caret notation are allowed.
Examples:
70 92.67 -69.69
~~~
~1~~5
^^^5
^^^
^2^1^8.5
~1.73~9.47~-10.23
70 ~ 63
19.38 ~-2210.21038 124065123478
location
A set of coordinates, relative coordinates are allowed.
Examples:
70 92.67 -69.69
~~~
~1~~5
~1.73~9.47~-10.23
70 ~ 63
19.38 ~-2210.21038 124065123478
~
A tilde. ~
Dimension
The name or namespaced id of a dimension. Valid values are overworld
, nether
, the_end
, minecraft:overworld
, minecraft:nether
, and minecraft:the_end
.
RGBA
A 4-character RGBA hexadecimal color code. ex. F927
RRGGBBAA
An 8-character RGBA hexadecimal color code. ex. FE932B76
RGB
A 3-character RGB hexadecimal color code. ex. F92
RRGGBB
A 6-character RGB hexadecimal color code. ex. FE932B
{<string>}
This parameter type means that the value you type in for it is the exact text that is inside of the {}
. For example if the parameter type is {testabcd}
then for the parameter you would type in testabcd
.
(<parameterType>|<parameterType>)
This parameter type means that it can actually be any of the parameter types separated by vertical lines |
inside of the parentheses ()
. For example, if your parameter was [value: (number|(string|JSONArray)[maxLength=2])[?=5]]
then for the parameter you could do a number, a string with a max length of 2, a JSONArray with a max length of 2, or nothing, and if you put nothing then it will just default to 5
.