EntitySelectorBuilder

Builder class for creating EntitySelector instances with a fluent API.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun advancements(advancement: Identifier, isDone: Boolean): EntitySelectorBuilder
fun advancements(advancement: Identifier, criterion: String, isDone: Boolean): EntitySelectorBuilder

Filter target selection based on the entity's advancements. This naturally filters out all non-player targets.

Link copied to clipboard
fun create(): EntitySelector

Build an EntitySelector instance based on the current configuration of this builder.

Link copied to clipboard
fun distance(minDistance: Double, maxDistance: Double): EntitySelectorBuilder

Filter target selection based on their Euclidean distances from some point, searching for the target's feet (a point at the bottom of the center of their hitbox).

Link copied to clipboard

Filter target selection based on their Euclidean distances from some point, searching for the target's feet (a point at the bottom of the center of their hitbox).

Link copied to clipboard

Filter target selection based on their Euclidean distances from some point, searching for the target's feet (a point at the bottom of the center of their hitbox).

Link copied to clipboard

Used for volume-based selection. Similar to the "dx" argument in target selectors in commands.

Link copied to clipboard

Used for volume-based selection. Similar to the "dy" argument in target selectors in commands.

Link copied to clipboard

Used for volume-based selection. Similar to the "dz" argument in target selectors in commands.

Link copied to clipboard
fun gamemode(gamemode: GameType, inverse: Boolean): EntitySelectorBuilder

Filter target selection by game mode. This naturally filters out all non-player targets.

Link copied to clipboard

Adds a predicate to filter only alive entities.

Link copied to clipboard
fun level(minLevel: Int, maxLevel: Int): EntitySelectorBuilder

Filter target selection based on the entity's experience levels. This naturally filters out all non-player targets.

Link copied to clipboard

Filter target selection based on the entity's experience levels. This naturally filters out all non-player targets.

Link copied to clipboard

Filter target selection based on the entity's experience levels. This naturally filters out all non-player targets.

Link copied to clipboard

Limit the number of selectable targets for a target selector

Link copied to clipboard
fun name(name: String, inverse: Boolean = false): EntitySelectorBuilder

Filter target selection by name.

Link copied to clipboard
fun nbt(nbt: CompoundTag, inverse: Boolean): EntitySelectorBuilder

Filter target selection based on the entity's NBT data. Note that this selector argument should be used with care, as accessing NBT data is a heavy process for the CPU.

Link copied to clipboard

Sets the sorting order of the selector results. If not set, defaults to arbitrary order.

Link copied to clipboard

Sets the sorting order of the selector results. If not set, defaults to arbitrary order.

Link copied to clipboard

Sets the sorting order of the selector results. If not set, defaults to arbitrary order.

Link copied to clipboard

Sets the sorting order of the selector results. If not set, defaults to arbitrary order.

Link copied to clipboard
fun predicate(predicateKey: ResourceKey<LootItemCondition>, inverse: Boolean): EntitySelectorBuilder
fun predicate(predicate: LootItemCondition, inverse: Boolean): EntitySelectorBuilder

Filter target selection by predicates.

Link copied to clipboard
fun score(objectiveName: String, min: Int? = null, max: Int? = null): EntitySelectorBuilder

Filter target selection based on their scores in the specified objectives.

Link copied to clipboard

Filter target selection based on the entity's scoreboard tags.

Link copied to clipboard

Filter target selection based on teams.

Link copied to clipboard
fun type(type: Identifier, inverse: Boolean): EntitySelectorBuilder
fun type(typeTag: TagKey<EntityType<*>>, inverse: Boolean): EntitySelectorBuilder

Filter target selection based on entity type. If inverse is true, selects entities that are NOT of the specified type.

fun type(entityType: EntityType<*>, inverse: Boolean = false): EntitySelectorBuilder

Sets the entity type to filter by. If inverse is true, selects entities that are NOT of the specified type.

Link copied to clipboard

Used for volume-based selection. Similar to the "x" argument in target selectors in commands.

Link copied to clipboard
fun x_rotation(minDegrees: Float, maxDegrees: Float): EntitySelectorBuilder

Filter target selection based on the entity's rotation along the pitch axis, measured in degrees.

Link copied to clipboard

Used for volume-based selection. Similar to the "y" argument in target selectors in commands.

Link copied to clipboard
fun y_rotation(minDegrees: Float, maxDegrees: Float): EntitySelectorBuilder

Filter target selection based on the entity's rotation along the yaw axis, measured clockwise in degrees from due south (or the positive Z direction).

Link copied to clipboard

Used for volume-based selection. Similar to the "z" argument in target selectors in commands.