Interface Selector.Builder
- All Superinterfaces:
- AbstractBuilder<Selector>,- Builder<Selector,,- Selector.Builder> - ResettableBuilder<Selector,- Selector.Builder> 
- Enclosing interface:
- Selector
Selector based on the provided criteria.- 
Method SummaryModifier and TypeMethodDescriptionaddAdvancement(Advancement advancement) Adds anAdvancementconstraint to this selector, requiring that the advancement must be granted to be selected.addAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion) Adds anAdvancementCriterionconstraint to this selector, requiring that the criterion on the givenAdvancementmust be granted to be selected.addEntityType(Supplier<EntityType<?>> type, boolean inherit) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must be of the given type.addEntityType(EntityType<?> type, boolean inherit) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must be of the given type.Applies a custom filter to the selector that must also be met by anyentitiesthat may otherwise be selected by this selector.addGameMode(Supplier<? extends GameMode> mode) Adds aGameModeconstraint to the selector, requiring players be in the given game mode.addGameMode(GameMode mode) Adds aGameModeconstraint to the selector, requiring players be in the given game modeAdds a name constraint to the selector, requiring that entities have a specific name.addNotAdvancement(Advancement advancement) Adds anAdvancementconstraint to this selector, requiring that the advancement must NOT be granted to be selected.addNotAdvancementCriterion(Advancement advancement, AdvancementCriterion criterion) Adds anAdvancementCriterionconstraint to this selector, requiring that the criterion on the givenAdvancementmust not be granted to be selected.addNotEntityType(Supplier<EntityType<?>> type) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must not be of the given type.addNotEntityType(EntityType<?> type) Adds anEntityTypeconstraint to this selector, requiring that all selected entities must not be of the given type.addNotGameMode(Supplier<? extends GameMode> mode) Adds aGameModeconstraint to the selector, requiring that players are not in the given game modeaddNotGameMode(GameMode mode) Adds aGameModeconstraint to the selector, requiring that players are not in the given game modeaddNotName(String name) Adds a name constraint to the selector, requiring that entities do not have a specific name.Adds a tag constraint to the selector, requiring that entities do not have a given tag.addNotTeam(Team team) Adds aTeamconstraint to the selector, requiring that players are not in a specific teamaddObjective(Objective objective, Range<Integer> range) Adds anObjectiveconstraint to the selector, requiring that players have a given score in an objective in a given range (inclusive).Adds a tag constrain to the selector, requiring that entities have a given tag.Adds aTeamconstraint to the selector, requiring that players are in a specific teamanyTeam()Adds aTeamconstraint to the selector, requiring that players are in any teamapplySelectorType(Supplier<? extends SelectorType> selectorType) Applies the defaults associated with a givenSelectorTypeapplySelectorType(SelectorType selectorType) Applies the defaults associated with a givenSelectorTypebuild()Creates aSelectorbased on this builder.Adds anDataViewas an NBT style constraint.Sets the minimum and/or maximum distance from the target location that this selector will look.experienceLevel(Range<Integer> range) Adds an experience level constraint to the selector, specifying that a player's level must be in the provided range (inclusive).If the selector's source is anEntityand this is called, the source is eligible to be selected if all other criteria are met.limit(int limit) Limits the number ofentitiesreturned by the selector.noTeam()Adds aTeamconstraint to the selector, requiring that players are not in any teamAdds a pitch constraint to the selector, requiring that entities have a pitch (x_rotation) within the given range, inclusive.sortAlgorithm(Supplier<? extends SelectorSortAlgorithm> algorithm) Sets the sorting algorithm to use when returning entities from the selector.sortAlgorithm(SelectorSortAlgorithm algorithm) Sets the sorting algorithm to use when returning entities from the selector.Sets the volume that entities can be selected from.Adds a yaw constraint to the selector, requiring that entities have a yaw (y_rotation) within the given range, inclusive.
- 
Method Details- 
applySelectorTypeApplies the defaults associated with a givenSelectorType- Parameters:
- selectorType- The- SelectorType
- Returns:
- This builder, for chaining
 
- 
applySelectorTypeApplies 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.
 
- 
limitLimits the number ofentitiesreturned by the selector.- Parameters:
- limit- The maximum number of entities to return
- Returns:
- This builder, for chaining
 
- 
distanceSets the minimum and/or maximum distance from the target location that this selector will look.- Parameters:
- range- The range
- Returns:
- This builder, for chaining
 
- 
volumeSets 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
 
- 
sortAlgorithmSets the sorting algorithm to use when returning entities from the selector.- Parameters:
- algorithm- The- SelectorSortAlgorithm
- Returns:
- This builder, for chaining
 
- 
sortAlgorithmSets the sorting algorithm to use when returning entities from the selector.- Parameters:
- algorithm- The- SelectorSortAlgorithm
- Returns:
- This builder, for chaining
 
- 
addAdvancementAdds 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
 
- 
addNotAdvancementAdds 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
 
- 
addAdvancementCriterionAdds 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
 
- 
dataViewAdds anDataViewas an NBT style constraint.- Parameters:
- view- The data view
- Returns:
- This builder, for chaining
 
- 
addEntityTypeAdds 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
 
- 
addEntityTypeAdds 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
 
- 
addNotEntityTypeAdds 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
 
- 
addNotEntityTypeAdds 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
 
- 
experienceLevelAdds 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
 
- 
addGameModeAdds 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
 
- 
addGameModeAdds 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
 
- 
addNotGameModeAdds 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
 
- 
addNotGameModeAdds 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
 
- 
addTeamAdds 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
 
- 
addNotTeamAdds 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
 
- 
addNameAdds 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
 
- 
addNotNameAdds 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
 
- 
addObjectiveAdds 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
 
- 
addTagAdds 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
 
- 
addNotTagAdds 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
 
- 
pitchAdds 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
 
- 
yawAdds 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
 
- 
addFilterApplies 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
 
- 
buildCreates aSelectorbased on this builder.- Specified by:
- buildin interface- AbstractBuilder<Selector>
- Returns:
- A Selector
- Throws:
- IllegalStateException- if the builder could not create a selector
 
 
-