Class EntitySelectorParser

java.lang.Object
net.minecraft.commands.arguments.selector.EntitySelectorParser

public class EntitySelectorParser extends Object
  • Field Details

    • SYNTAX_SELECTOR_START

      public static final char SYNTAX_SELECTOR_START
      See Also:
      Constant Field Values
    • SYNTAX_OPTIONS_START

      private static final char SYNTAX_OPTIONS_START
      See Also:
      Constant Field Values
    • SYNTAX_OPTIONS_END

      private static final char SYNTAX_OPTIONS_END
      See Also:
      Constant Field Values
    • SYNTAX_OPTIONS_KEY_VALUE_SEPARATOR

      public static final char SYNTAX_OPTIONS_KEY_VALUE_SEPARATOR
      See Also:
      Constant Field Values
    • SYNTAX_OPTIONS_SEPARATOR

      private static final char SYNTAX_OPTIONS_SEPARATOR
      See Also:
      Constant Field Values
    • SYNTAX_NOT

      public static final char SYNTAX_NOT
      See Also:
      Constant Field Values
    • SYNTAX_TAG

      public static final char SYNTAX_TAG
      See Also:
      Constant Field Values
    • SELECTOR_NEAREST_PLAYER

      private static final char SELECTOR_NEAREST_PLAYER
      See Also:
      Constant Field Values
    • SELECTOR_ALL_PLAYERS

      private static final char SELECTOR_ALL_PLAYERS
      See Also:
      Constant Field Values
    • SELECTOR_RANDOM_PLAYERS

      private static final char SELECTOR_RANDOM_PLAYERS
      See Also:
      Constant Field Values
    • SELECTOR_CURRENT_ENTITY

      private static final char SELECTOR_CURRENT_ENTITY
      See Also:
      Constant Field Values
    • SELECTOR_ALL_ENTITIES

      private static final char SELECTOR_ALL_ENTITIES
      See Also:
      Constant Field Values
    • ERROR_INVALID_NAME_OR_UUID

      public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID_NAME_OR_UUID
    • ERROR_UNKNOWN_SELECTOR_TYPE

      public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_SELECTOR_TYPE
    • ERROR_SELECTORS_NOT_ALLOWED

      public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_SELECTORS_NOT_ALLOWED
    • ERROR_MISSING_SELECTOR_TYPE

      public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_MISSING_SELECTOR_TYPE
    • ERROR_EXPECTED_END_OF_OPTIONS

      public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_EXPECTED_END_OF_OPTIONS
    • ERROR_EXPECTED_OPTION_VALUE

      public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_EXPECTED_OPTION_VALUE
    • ORDER_ARBITRARY

      public static final BiConsumer<Vec3,​List<? extends Entity>> ORDER_ARBITRARY
    • ORDER_NEAREST

      public static final BiConsumer<Vec3,​List<? extends Entity>> ORDER_NEAREST
    • ORDER_FURTHEST

      public static final BiConsumer<Vec3,​List<? extends Entity>> ORDER_FURTHEST
    • ORDER_RANDOM

      public static final BiConsumer<Vec3,​List<? extends Entity>> ORDER_RANDOM
    • SUGGEST_NOTHING

      public static final BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,​CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING
    • reader

      private final com.mojang.brigadier.StringReader reader
    • allowSelectors

      private final boolean allowSelectors
    • maxResults

      private int maxResults
    • includesEntities

      private boolean includesEntities
    • worldLimited

      private boolean worldLimited
    • distance

      private MinMaxBounds.Doubles distance
    • level

      private MinMaxBounds.Ints level
    • x

      @Nullable private Double x
    • y

      @Nullable private Double y
    • z

      @Nullable private Double z
    • deltaX

      @Nullable private Double deltaX
    • deltaY

      @Nullable private Double deltaY
    • deltaZ

      @Nullable private Double deltaZ
    • rotX

      private WrappedMinMaxBounds rotX
    • rotY

      private WrappedMinMaxBounds rotY
    • predicate

      private Predicate<Entity> predicate
    • order

      private BiConsumer<Vec3,​List<? extends Entity>> order
    • currentEntity

      private boolean currentEntity
    • playerName

      @Nullable private String playerName
    • startPosition

      private int startPosition
    • entityUUID

      @Nullable private UUID entityUUID
    • suggestions

      private BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,​CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
    • hasNameEquals

      private boolean hasNameEquals
    • hasNameNotEquals

      private boolean hasNameNotEquals
    • isLimited

      private boolean isLimited
    • isSorted

      private boolean isSorted
    • hasGamemodeEquals

      private boolean hasGamemodeEquals
    • hasGamemodeNotEquals

      private boolean hasGamemodeNotEquals
    • hasTeamEquals

      private boolean hasTeamEquals
    • hasTeamNotEquals

      private boolean hasTeamNotEquals
    • type

      @Nullable private EntityType<?> type
    • typeInverse

      private boolean typeInverse
    • hasScores

      private boolean hasScores
    • hasAdvancements

      private boolean hasAdvancements
    • usesSelectors

      private boolean usesSelectors
  • Constructor Details

    • EntitySelectorParser

      public EntitySelectorParser(com.mojang.brigadier.StringReader p_121218_)
    • EntitySelectorParser

      public EntitySelectorParser(com.mojang.brigadier.StringReader p_121220_, boolean p_121221_)
  • Method Details

    • getSelector

      public EntitySelector getSelector()
    • createAabb

      private AABB createAabb(double p_121234_, double p_121235_, double p_121236_)
    • finalizePredicates

      public void finalizePredicates()
    • createRotationPredicate

      private Predicate<Entity> createRotationPredicate(WrappedMinMaxBounds p_121255_, ToDoubleFunction<Entity> p_121256_)
    • parseSelector

      protected void parseSelector() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseNameOrUUID

      protected void parseNameOrUUID() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseOptions

      public void parseOptions() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • shouldInvertValue

      public boolean shouldInvertValue()
    • isTag

      public boolean isTag()
    • getReader

      public com.mojang.brigadier.StringReader getReader()
    • addPredicate

      public void addPredicate(Predicate<Entity> p_121273_)
    • setWorldLimited

      public void setWorldLimited()
    • getDistance

      public MinMaxBounds.Doubles getDistance()
    • setDistance

      public void setDistance(MinMaxBounds.Doubles p_175128_)
    • getLevel

      public MinMaxBounds.Ints getLevel()
    • setLevel

      public void setLevel(MinMaxBounds.Ints p_121246_)
    • getRotX

      public WrappedMinMaxBounds getRotX()
    • setRotX

      public void setRotX(WrappedMinMaxBounds p_121253_)
    • getRotY

      public WrappedMinMaxBounds getRotY()
    • setRotY

      public void setRotY(WrappedMinMaxBounds p_121290_)
    • getX

      @Nullable public Double getX()
    • getY

      @Nullable public Double getY()
    • getZ

      @Nullable public Double getZ()
    • setX

      public void setX(double p_121232_)
    • setY

      public void setY(double p_121283_)
    • setZ

      public void setZ(double p_121306_)
    • setDeltaX

      public void setDeltaX(double p_121319_)
    • setDeltaY

      public void setDeltaY(double p_121332_)
    • setDeltaZ

      public void setDeltaZ(double p_121340_)
    • getDeltaX

      @Nullable public Double getDeltaX()
    • getDeltaY

      @Nullable public Double getDeltaY()
    • getDeltaZ

      @Nullable public Double getDeltaZ()
    • setMaxResults

      public void setMaxResults(int p_121238_)
    • setIncludesEntities

      public void setIncludesEntities(boolean p_121280_)
    • getOrder

      public BiConsumer<Vec3,​List<? extends Entity>> getOrder()
    • setOrder

      public void setOrder(BiConsumer<Vec3,​List<? extends Entity>> p_121269_)
    • parse

      public EntitySelector parse() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • fillSelectorSuggestions

      private static void fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121248_)
    • suggestNameOrSelector

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestNameOrSelector(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121287_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121288_)
    • suggestName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121310_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121311_)
    • suggestSelector

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestSelector(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121323_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121324_)
    • suggestOpenOptions

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenOptions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121334_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121335_)
    • suggestOptionsKeyOrClose

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOptionsKeyOrClose(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121342_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121343_)
    • suggestOptionsKey

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOptionsKey(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121348_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121349_)
    • suggestOptionsNextOrClose

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOptionsNextOrClose(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121354_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121355_)
    • suggestEquals

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestEquals(com.mojang.brigadier.suggestion.SuggestionsBuilder p_175144_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_175145_)
    • isCurrentEntity

      public boolean isCurrentEntity()
    • setSuggestions

      public void setSuggestions(BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,​CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> p_121271_)
    • fillSuggestions

      public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_121250_, Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_121251_)
    • hasNameEquals

      public boolean hasNameEquals()
    • setHasNameEquals

      public void setHasNameEquals(boolean p_121303_)
    • hasNameNotEquals

      public boolean hasNameNotEquals()
    • setHasNameNotEquals

      public void setHasNameNotEquals(boolean p_121316_)
    • isLimited

      public boolean isLimited()
    • setLimited

      public void setLimited(boolean p_121329_)
    • isSorted

      public boolean isSorted()
    • setSorted

      public void setSorted(boolean p_121337_)
    • hasGamemodeEquals

      public boolean hasGamemodeEquals()
    • setHasGamemodeEquals

      public void setHasGamemodeEquals(boolean p_121345_)
    • hasGamemodeNotEquals

      public boolean hasGamemodeNotEquals()
    • setHasGamemodeNotEquals

      public void setHasGamemodeNotEquals(boolean p_121351_)
    • hasTeamEquals

      public boolean hasTeamEquals()
    • setHasTeamEquals

      public void setHasTeamEquals(boolean p_121357_)
    • hasTeamNotEquals

      public boolean hasTeamNotEquals()
    • setHasTeamNotEquals

      public void setHasTeamNotEquals(boolean p_121360_)
    • limitToType

      public void limitToType(EntityType<?> p_121242_)
    • setTypeLimitedInversely

      public void setTypeLimitedInversely()
    • isTypeLimited

      public boolean isTypeLimited()
    • isTypeLimitedInversely

      public boolean isTypeLimitedInversely()
    • hasScores

      public boolean hasScores()
    • setHasScores

      public void setHasScores(boolean p_121366_)
    • hasAdvancements

      public boolean hasAdvancements()
    • setHasAdvancements

      public void setHasAdvancements(boolean p_121369_)