Placeholder for entities in radius

Quite a multifunctional placeholder, allows you to get entities in radius by specified coordinates.


Meaning

Allows you to get entities in radius by specified coordinates, both the fact of existence and number, and complete lists and values in these lists by index.


Format

Check presence of entities:

%CEP_entitiesInRadius_<world>_<x>_<y>_<z>_<radius>_<include (true|false)>_(optional) <filter1>,<filter2>,<filterN>% # Check if the entities exist at the location in the specified radius, will return "true" or "false"

<world>_<x>_<y>_<z> – the central location to check the entities; (MANDATORY)

<radius> – the radius to check; (MANDATORY)

<include> – if current player exists, you can include it to the list or not; (MANDATORY)

<filters> – see in the table below (you can skip filters to get all entities, but the last underscore should be in any case!). (OPTIONAL)


Get count of entities:

%CEP_entitiesCountInRadius_<world>_<x>_<y>_<z>_<radius>_<include (true|false)>_(optional) <filter1>,<filter2>,<filterN>% # Check the amount of the entities at the location in the specified radius, will return the amount

<world>_<x>_<y>_<z> – the central location to check the entities; (MANDATORY)

<radius> – the radius to check; (MANDATORY)

<include> – if current player exists, you can include it to the list or not; (MANDATORY)

<filters> – see in the table below (you can skip filters to get all entities, but the last underscore should be in any case!). (OPTIONAL)


Get list of entities:

%CEP_entitiesListInRadius_<separator>_<world>_<x>_<y>_<z>_<radius>_<output>_<include (true|false)>_(optional) <filter1>,<filter2>,<filterN>% # Check the list of the entities at the location in the specified radius, will return the list of entities with data from the specified output

<separator> – the separator to separate the elements, it is needed to separate elements in the output list; (MANDATORY)

<world>_<x>_<y>_<z> – the central location to check the entities; (MANDATORY)

<radius> – the radius to check; (MANDATORY)

<output> – the output to return, may be uuid, type, enum, name, coords or type,type ("type,type" is useful to get exactly the block type, and not the entity, for example, for “falling” filter); (MANDATORY)

<include> – if current player exists, you can include it to the list or not; (MANDATORY)

<filters> – see in the table below (you can skip filters to get all entities, but the last underscore should be in any case!). (OPTIONAL)


Get entity at index in list of entities:

%CEP_entityAtIndexInRadius_<separator>_<world>_<x>_<y>_<z>_<radius>_<index_in_list>_<output>_<include (true|false)>_(optional) <filter1>,<filter2>,<filterN>% # Check the list of the entities at the location in the specified radius, will return the entity at the specified index in this list with data from the specified output

<separator> – the separator to separate the elements in different cases, it is needed when more than one element is outputting, for example in "coords" output type; (MANDATORY)

<world>_<x>_<y>_<z> – the central location to check the entities; (MANDATORY)

<radius> – the radius to check; (MANDATORY)

<index_in_list> – the index in the list to return the entity (counting is starting from 0, consider it!); (MANDATORY)

<output> – the output to return, may be uuid, type, enum, name, coords or type,type ("type,type" is useful to get exactly the block type, and not the entity, for example, for “falling” filter); (MANDATORY)

<include> – if current player exists, you can include it to the list or not; (MANDATORY)

<filters> – see in the table below (you can skip filters to get all entities, but the last underscore should be in any case!). (OPTIONAL)


Table of the available filters (filters are presented in the order by their priorities from the highest one, that is, for example, specifying the "mobs" or "!mobs" will have the priority above the "livingEntities" or "!livingEntities", the same as "monsters" above "mobs" etc):

Available filters (to include)
Negative aliases (to exclude)
Meaning

players

!players

monsters

!monsters

Aggressive monsters like zombies or skeletons

animals

!animals

Kind animals like cows or sheeps

waterMobs

!waterMobs

Water mobs like squids

NPCs

!NPCs

NPCs, like villagers or wandering traders

ambients

!ambients

Ambient mobs like bats

items

!items

Items on the ground

vehicles

!vehicles

Vehicles like minecarts or boats

projectiles

!projectiles

Projectiles like arrows

hanging

!hanging

Hanging entities like paintings or tethered leashes

falling

!falling

Falling entities like falling sand or gravel, "type,type" output option is useful here to get exactly the block type, and not the entity

tnt

!tnt

mobs

!mobs

All mobs, including "monsters", "animals", "waterMobs" and "ambients"

livingEntities

!livingEntities

All living entities, including "mobs", "players", entities like armor stands, etc



Targets
  • Any entities.


Where is useful

For example, if you need to get entities in a radius at certain coordinates, find out if a certain entity is there and perform certain actions, like removing that entity via the change_entities action, modifying it via the change_item action or in case of vehicles set the passenger of the found vehicle via change_passenger action. To process a list from this placeholder, the array placeholder is very useful.


Examples
%CEP_entitiesListInRadius_,_{player_world}_{player_x}_{player_y}_{player_z}_10_uuid_false_players,mobs,!CREEPER% # Get the list of the uuids of entities (separating the list through the "," symbol) at the player coordinates in 10 blocks radius including players and any mobs, excluding the current player and creepers
%CEP_entityAtIndexInRadius_ | _{player_world}_{player_x}_{player_y}_{player_z}_5_2_coords_false_vehicles% # Get the location of the third vehicle (at the second index, but counting from 0) in the list of vehicle entities at the player coordinates in 5 blocks radius (separating the coordinates through the " | ")

Last updated