Placeholder for random block in area

A very powerful placeholder that allows you to get a random block in the specified area.


Meaning

Allows you to get a random block in the specified area, using the many different useful options and filters.


Format
%CEP_randomBlock_<world>_<minX>_<minY>_<minZ>_<maxX>_<maxY>_<maxZ>_<output1>_<output2>_<outputN>_(optional) <filters>_(optional) highest-|+<number>_(optional) blocks=<block1>,<block2>,<blockN>;block-data=<block_data1>|<block_data2>|<block_dataN>;coords=<location1>|<location2>|<locationN>%

<world>_<minX>_<minY>_<minZ>_<maxX>_<maxY>_<maxZ> – the area to choose the block from; (MANDATORY)

<outputs> – may be type, x, y, z or world (you can combine them via "_", but at least one should exists); (MANDATORY)

<filters> – may be solid, fluid or !air (you can combine them via "_" too); (OPTIONAL)

highest-|+<number> – allows you to specify at what height you want to search for a block, starting from the highest block in the specified area, before the number comes the sign + or -, then the number itself, the highest blocks in the specified area can be many, and if starting from it, adding your number, there will be a suitable block, it will be selected; (OPTIONAL)

blocks=<block1>,<block2>,<blockN>;block-data=<block_data1>|<block_data2>|<block_dataN>;coords=<location1>|<location2>|<locationN> – the additional filters, their order and presence is not important, the main thing is to separate them by semicolons, you can use the “contains”, “startsWith”, “endsWith” and their !-versions in the "blocks" and "block-data", but not in the "coords"! You can use everywhere "!" before something to exclude it, and this is already available in "coords". If you choose not to specify “contains” and the like in "block-data", but a full expression with ! or not, you need to specify the full data format as minecraft:<block>[<data>=<value>]. You can use "~" to specify the coordinate ranges in the "coords", you can exclude coordinates from the current range or add coordinates outside the current range, and coordinates added in the current range will take precedence over those excluded in the current range. (OPTIONAL)


Big but important information:


Targets
  • Blocks.


Where is useful

Can be useful in creating some mini-games with random blocks choosing and in many other cases.


Examples
%CEP_randomBlock_{player_world}_{math_0:DOWN_{player_x}-5}_{math_0:DOWN_{player_y}-5}_{math_0:DOWN_{player_z}-5}_{math_0:DOWN_{player_x}+5}_{math_0:DOWN_{player_y}+5}_{math_0:DOWN_{player_z}+5}_type_x_y_z_!air_solid_fluid_highest-3_blocks=!DIRT,!ANDESITE% # Output the type and coordinates of a random block within 5 blocks radius of the current player, excluding air, including solid and liquid blocks, at a height of -3 blocks from some highest block, excluding dirt and andesite, that is, it can be, for example, stone, water, lava etc
%CEP_randomBlock_{player_world}_{math_0:DOWN_{player_x}-5}_{math_0:DOWN_{player_y}-5}_{math_0:DOWN_{player_z}-5}_{math_0:DOWN_{player_x}+5}_{math_0:DOWN_{player_y}+5}_{math_0:DOWN_{player_z}+5}_type_x_y_z_blocks=endsWith WOOL,!startsWith L;block-data=contains lit=true;coords=coords=!world,53,23,424~47,19,418|world,52,22,422|testᵕworld,10,52,1152% # Output the type and coordinates of a random block within 5 blocks radius of the current player, including only wool which is not starting with "L" letter, also including any blocks with data "lit=true", excluding the specified range of coordinates from the current search, including one block back from that range and including one block from world test_world (that is, significantly another location), that is, it can be, for example green wool, orange wool, campfires, torches and some different blocks by coordinates