onyx.selector
- class onyx.selector.Selector(type=selector_type.all_entities, advancements=None, distance=None, dx=None, dy=None, dz=None, gamemode=None, level=None, limit=None, name=None, nbt=None, predicate=None, scores=None, sort=None, tag=None, team=None, x=None, y=None, z=None, x_rotation=None, y_rotation=None)
Selector - Represents a selector
- Parameters
type (selector_type, optional) – The type of selector (
@e
, ``@s`, etc.). Defaults to selector_type.all_entities.advancements (dict, optional) – The advancements of the entity. Defaults to None.
distance (Union[int, Range], optional) – The distance of the entity from a certain point. Defaults to None.
dx (int, optional) – How far away the entity can be from
x
in the positive X-axis. Defaults to None.dy (int, optional) – How far away the entity can be from
y
in the positive Y-axis. Defaults to None.dz (int, optional) – How far away the entity can be from
z
in the positive Z-axis. Defaults to None.gamemode (gamemode, optional) – The gamemode of the entity. Defaults to None.
level (int, optional) – The experience points the entity must have. Defaults to None.
limit (int, optional) – The amount of entities that can be selected. Defaults to None.
name (str, optional) – The name of the entity. Defaults to None.
nbt (Compound, optional) – The NBT of the entity. Defaults to None.
predicate (Union[str, list], optional) – The predicates that must apply to the entity. Defaults to None.
scores (dict, optional) – The scores of the entity. Should be given as a dictionary with the keys being the objectives and the values being the values. Defaults to None.
sort (entity_sort, optional) – How the entities will be sorted if multiple are selected. Defaults to None.
tag (Union[str, list], optional) – The tags of the entity. If this is a list, then multiple
tag
entries will be created in the selector. Example:tag=["tag1", "tag2"]
=>tag=tag1, tag=2
. Defaults to None.team (Union[str, list], optional) – The team of the entity. If this is a list, then multiple
team
entries will be created in the selector. Example:team=["team1", "team2"]
=>team=team1, team=team2
. However, this selector will always fail, since an entity can only be on one team. As such, a list should only be specified if you’re negating multiple teams. Defaults to None.x (int, optional) – The point on the X-axis of the entity. Defaults to None.
y (int, optional) – The point on the Y-axis of the entity. Defaults to None.
z (int, optional) – The point on the Z-axis of the entity. Defaults to None.
x_rotation (Union[int, Range], optional) – The rotation of the entity on the X-axis (vertical). Defaults to None.
y_rotation (Union[int, Range], optional) – The rotation of the entity on the Y-axis (horizontal). Defaults to None.
- build()
build - Returns the built selector
- Returns
The built selector
- Return type
str