Interface Selector.Builder
- 
- All Superinterfaces:
- AbstractBuilder<Selector>,- Buildable.Builder<Selector>,- Builder<Selector,Selector.Builder>,- ResettableBuilder<Selector,Selector.Builder>
 - Enclosing interface:
- Selector
 
 public static interface Selector.Builder extends Builder<Selector,Selector.Builder> Creates aSelectorbased on the provided criteria.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Selector.BuilderaddAdvancement(Advancement advancement)Adds anAdvancementconstraint to this selector, requiring that the advancement must be granted to be selected.Selector.BuilderaddAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion)Adds anAdvancementCriterionconstraint to this selector, requiring that the criterion on the givenAdvancementmust be granted to be selected.Selector.BuilderaddEntityType(java.util.function.Supplier<EntityType<?>> type, boolean inherit)Adds anEntityTypeconstraint to this selector, requiring that all selected entities must be of the given type.Selector.BuilderaddEntityType(EntityType<?> type, boolean inherit)Adds anEntityTypeconstraint to this selector, requiring that all selected entities must be of the given type.Selector.BuilderaddFilter(java.util.function.Predicate<Entity> filter)Applies a custom filter to the selector that must also be met by anyentitiesthat may otherwise be selected by this selector.Selector.BuilderaddGameMode(java.util.function.Supplier<? extends GameMode> mode)Adds aGameModeconstraint to the selector, requiring players be in the given game mode.Selector.BuilderaddGameMode(GameMode mode)Adds aGameModeconstraint to the selector, requiring players be in the given game modeSelector.BuilderaddName(java.lang.String name)Adds a name constraint to the selector, requiring that entities have a specific name.Selector.BuilderaddNotAdvancement(Advancement advancement)Adds anAdvancementconstraint to this selector, requiring that the advancement must NOT be granted to be selected.Selector.BuilderaddNotAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion)Adds anAdvancementCriterionconstraint to this selector, requiring that the criterion on the givenAdvancementmust not be granted to be selected.Selector.BuilderaddNotEntityType(java.util.function.Supplier<EntityType<?>> type)Adds anEntityTypeconstraint to this selector, requiring that all selected entities must not be of the given type.Selector.BuilderaddNotEntityType(EntityType<?> type)Adds anEntityTypeconstraint to this selector, requiring that all selected entities must not be of the given type.Selector.BuilderaddNotGameMode(java.util.function.Supplier<? extends GameMode> mode)Adds aGameModeconstraint to the selector, requiring that players are not in the given game modeSelector.BuilderaddNotGameMode(GameMode mode)Adds aGameModeconstraint to the selector, requiring that players are not in the given game modeSelector.BuilderaddNotName(java.lang.String name)Adds a name constraint to the selector, requiring that entities do not have a specific name.Selector.BuilderaddNotTag(java.lang.String tag)Adds a tag constraint to the selector, requiring that entities do not have a given tag.Selector.BuilderaddNotTeam(Team team)Adds aTeamconstraint to the selector, requiring that players are not in a specific teamSelector.BuilderaddObjective(Objective objective, Range<java.lang.Integer> range)Adds anObjectiveconstraint to the selector, requiring that players have a given score in an objective in a given range (inclusive).Selector.BuilderaddTag(java.lang.String tag)Adds a tag constrain to the selector, requiring that entities have a given tag.Selector.BuilderaddTeam(Team team)Adds aTeamconstraint to the selector, requiring that players are in a specific teamSelector.BuilderanyTeam()Adds aTeamconstraint to the selector, requiring that players are in any teamSelector.BuilderapplySelectorType(java.util.function.Supplier<? extends SelectorType> selectorType)Applies the defaults associated with a givenSelectorTypeSelector.BuilderapplySelectorType(SelectorType selectorType)Applies the defaults associated with a givenSelectorTypeSelectorbuild()Creates aSelectorbased on this builder.Selector.BuilderdataView(DataView view)Adds anDataViewas an NBT style constraint.Selector.Builderdistance(Range<java.lang.Double> range)Sets the minimum and/or maximum distance from the target location that this selector will look.Selector.BuilderexperienceLevel(Range<java.lang.Integer> range)Adds an experience level constraint to the selector, specifying that a player's level must be in the provided range (inclusive).Selector.BuilderincludeSelf()If the selector's source is anEntityand this is called, the source is eligible to be selected if all other criteria are met.Selector.Builderlimit(int limit)Limits the number ofentitiesreturned by the selector.Selector.BuildernoTeam()Adds aTeamconstraint to the selector, requiring that players are not in any teamSelector.Builderpitch(Range<java.lang.Double> range)Adds a pitch constraint to the selector, requiring that entities have a pitch (x_rotation) within the given range, inclusive.Selector.BuildersortAlgorithm(java.util.function.Supplier<? extends SelectorSortAlgorithm> algorithm)Sets the sorting algorithm to use when returning entities from the selector.Selector.BuildersortAlgorithm(SelectorSortAlgorithm algorithm)Sets the sorting algorithm to use when returning entities from the selector.Selector.Buildervolume(Vector3d corner1, Vector3d corner2)Sets the volume that entities can be selected from.Selector.Builderyaw(Range<java.lang.Double> range)Adds a yaw constraint to the selector, requiring that entities have a yaw (y_rotation) within the given range, inclusive.
 
- 
- 
- 
Method Detail- 
applySelectorTypeSelector.Builder applySelectorType(java.util.function.Supplier<? extends SelectorType> selectorType) Applies the defaults associated with a givenSelectorType- Parameters:
- selectorType- The- SelectorType
- Returns:
- This builder, for chaining
 
 - 
applySelectorTypeSelector.Builder applySelectorType(SelectorType selectorType) Applies the defaults associated with a givenSelectorType- Parameters:
- selectorType- The- SelectorType
- Returns:
- This builder, for chaining
 
 - 
includeSelfSelector.Builder includeSelf() If the selector's source is anEntityand this is called, the source is eligible to be selected if all other criteria are met.- Returns:
- This builder, for chaining.
 
 - 
limitSelector.Builder limit(int limit) Limits the number ofentitiesreturned by the selector.- Parameters:
- limit- The maximum number of entities to return
- Returns:
- This builder, for chaining
 
 - 
distanceSelector.Builder distance(Range<java.lang.Double> range) Sets the minimum and/or maximum distance from the target location that this selector will look.- Parameters:
- range- The range
- Returns:
- This builder, for chaining
 
 - 
volumeSelector.Builder volume(Vector3d corner1, Vector3d corner2) Sets the volume that entities can be selected from. Entities that have any part of their hitbox within this two specified corners will be eligible to be selected.- Parameters:
- corner1- The first corner
- corner2- The second corner (may be equal to the first to select entities at a specific point instead)
- Returns:
- This builder, for chaining
 
 - 
sortAlgorithmSelector.Builder sortAlgorithm(java.util.function.Supplier<? extends SelectorSortAlgorithm> algorithm) Sets the sorting algorithm to use when returning entities from the selector.- Parameters:
- algorithm- The- SelectorSortAlgorithm
- Returns:
- This builder, for chaining
 
 - 
sortAlgorithmSelector.Builder sortAlgorithm(SelectorSortAlgorithm algorithm) Sets the sorting algorithm to use when returning entities from the selector.- Parameters:
- algorithm- The- SelectorSortAlgorithm
- Returns:
- This builder, for chaining
 
 - 
addAdvancementSelector.Builder addAdvancement(Advancement advancement) Adds anAdvancementconstraint to this selector, requiring that the advancement must be granted to be selected.- Parameters:
- advancement- The advancement that players must have.
- Returns:
- This builder, for chaining
 
 - 
addNotAdvancementSelector.Builder addNotAdvancement(Advancement advancement) Adds anAdvancementconstraint to this selector, requiring that the advancement must NOT be granted to be selected.- Parameters:
- advancement- The advancement that players must not have.
- Returns:
- This builder, for chaining
 
 - 
addAdvancementCriterionSelector.Builder addAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion) Adds anAdvancementCriterionconstraint to this selector, requiring that the criterion on the givenAdvancementmust be granted to be selected.- Parameters:
- advancement- The advancement
- criterion- The criterion the player must have
- Returns:
- This builder, for chaining
 
 - 
addNotAdvancementCriterionSelector.Builder addNotAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion) Adds anAdvancementCriterionconstraint to this selector, requiring that the criterion on the givenAdvancementmust not be granted to be selected.- Parameters:
- advancement- The advancement
- criterion- The criterion the player must not have
- Returns:
- This builder, for chaining
 
 - 
dataViewSelector.Builder dataView(DataView view) Adds anDataViewas an NBT style constraint.- Parameters:
- view- The data view
- Returns:
- This builder, for chaining
 
 - 
addEntityTypeSelector.Builder addEntityType(java.util.function.Supplier<EntityType<?>> type, boolean inherit) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must be of the given type.If inheritis true, entities may also be a subtype of the given type.- Parameters:
- type- The type
- inherit- Whether subtypes will also be selected
- Returns:
- This builder, for chaining
 
 - 
addEntityTypeSelector.Builder addEntityType(EntityType<?> type, boolean inherit) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must be of the given type.If inheritis true, entities may also be a subtype of the given type.- Parameters:
- type- The type
- inherit- Whether subtypes will also be selected
- Returns:
- This builder, for chaining
 
 - 
addNotEntityTypeSelector.Builder addNotEntityType(java.util.function.Supplier<EntityType<?>> type) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must not be of the given type.- Parameters:
- type- The type
- Returns:
- This builder, for chaining
 
 - 
addNotEntityTypeSelector.Builder addNotEntityType(EntityType<?> type) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must not be of the given type.- Parameters:
- type- The type
- Returns:
- This builder, for chaining
 
 - 
experienceLevelSelector.Builder experienceLevel(Range<java.lang.Integer> range) Adds an experience level constraint to the selector, specifying that a player's level must be in the provided range (inclusive).- Parameters:
- range- The range
- Returns:
- This builder, for chaining
 
 - 
addGameModeSelector.Builder addGameMode(java.util.function.Supplier<? extends GameMode> mode) Adds aGameModeconstraint to the selector, requiring players be in the given game mode.Cannot be used with addNotGameMode(GameMode).- Parameters:
- mode- The gamemode
- Returns:
- This builder, for chaining
 
 - 
addGameModeSelector.Builder addGameMode(GameMode mode) Adds aGameModeconstraint to the selector, requiring players be in the given game modeCannot be used with addNotGameMode(GameMode).- Parameters:
- mode- The gamemode
- Returns:
- This builder, for chaining
 
 - 
addNotGameModeSelector.Builder addNotGameMode(java.util.function.Supplier<? extends GameMode> mode) Adds aGameModeconstraint to the selector, requiring that players are not in the given game modeCannot be used with addGameMode(GameMode).- Parameters:
- mode- The gamemode
- Returns:
- This builder, for chaining
 
 - 
addNotGameModeSelector.Builder addNotGameMode(GameMode mode) Adds aGameModeconstraint to the selector, requiring that players are not in the given game modeCannot be used with addGameMode(GameMode).- Parameters:
- mode- The gamemode
- Returns:
- This builder, for chaining
 
 - 
anyTeamSelector.Builder anyTeam() Adds aTeamconstraint to the selector, requiring that players are in any team- Returns:
- This builder, for chaining
 
 - 
noTeamSelector.Builder noTeam() Adds aTeamconstraint to the selector, requiring that players are not in any team- Returns:
- This builder, for chaining
 
 - 
addTeamSelector.Builder addTeam(Team team) Adds aTeamconstraint to the selector, requiring that players are in a specific teamCannot be used with addNotTeam(Team)- Parameters:
- team- The specific team
- Returns:
- This builder, for chaining
 
 - 
addNotTeamSelector.Builder addNotTeam(Team team) Adds aTeamconstraint to the selector, requiring that players are not in a specific teamCannot be used with addTeam(Team)- Parameters:
- team- The specific team
- Returns:
- This builder, for chaining
 
 - 
addNameSelector.Builder addName(java.lang.String name) Adds a name constraint to the selector, requiring that entities have a specific name.Cannot be used with addNotName(String).- Parameters:
- name- The name
- Returns:
- This builder, for chaining
 
 - 
addNotNameSelector.Builder addNotName(java.lang.String name) Adds a name constraint to the selector, requiring that entities do not have a specific name.Cannot be used with addName(String).- Parameters:
- name- The name
- Returns:
- This builder, for chaining
 
 - 
addObjectiveSelector.Builder addObjective(Objective objective, Range<java.lang.Integer> range) Adds anObjectiveconstraint to the selector, requiring that players have a given score in an objective in a given range (inclusive).- Parameters:
- objective- The objective to check against
- range- The range
- Returns:
- This builder, for chaining
 
 - 
addTagSelector.Builder addTag(java.lang.String tag) Adds a tag constrain to the selector, requiring that entities have a given tag.Cannot be used with addNotTag(String).- Parameters:
- tag- The tag
- Returns:
- This builder, for chaining
 
 - 
addNotTagSelector.Builder addNotTag(java.lang.String tag) Adds a tag constraint to the selector, requiring that entities do not have a given tag.Cannot be used with addTag(String).- Parameters:
- tag- The tag
- Returns:
- This builder, for chaining
 
 - 
pitchSelector.Builder pitch(Range<java.lang.Double> range) Adds a pitch constraint to the selector, requiring that entities have a pitch (x_rotation) within the given range, inclusive.The pitch is in degrees, where 0 is considered parallel to the ground, -90 is straight up, and 90 is straight down. - Parameters:
- range- The range
- Returns:
- This builder, for chaining
 
 - 
yawSelector.Builder yaw(Range<java.lang.Double> range) Adds a yaw constraint to the selector, requiring that entities have a yaw (y_rotation) within the given range, inclusive.The yaw is in degrees, where 0 is considered due south. The angle is measured clockwise, so 90 is west, 180 is north and 270 is east. - Parameters:
- range- The range
- Returns:
- This builder, for chaining
 
 - 
addFilterSelector.Builder addFilter(java.util.function.Predicate<Entity> filter) Applies a custom filter to the selector that must also be met by anyentitiesthat may otherwise be selected by this selector.- Parameters:
- filter- A- Predicateused for filtering
- Returns:
- This builder, for chaining
 
 - 
buildSelector build() throws java.lang.IllegalStateException Creates aSelectorbased on this builder.- Specified by:
- buildin interface- AbstractBuilder<Selector>
- Specified by:
- buildin interface- Buildable.Builder<Selector>
- Returns:
- A Selector
- Throws:
- java.lang.IllegalStateException- if the builder could not create a selector
 
 
- 
 
-