Class EntitySelectorManager

java.lang.Object
net.minecraftforge.common.command.EntitySelectorManager

public class EntitySelectorManager extends Object
Allows modders to register custom entity selectors by assigning an IEntitySelectorType to a String token.
The token "test", for example, corresponds to @test[...] in a command.
  • Field Details

  • Constructor Details

    • EntitySelectorManager

      public EntitySelectorManager()
  • Method Details

    • register

      public static void register(String token, IEntitySelectorType type)
      Registers a new IEntitySelectorType for the given token.
      Parameters:
      token - Defines the name of the selector
    • parseSelector

      public static EntitySelector parseSelector(EntitySelectorParser parser) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      This method is called in EntitySelectorParser.parse()
      If the REGISTRY does not contain a custom selector for the command being parsed, this method returns null and the vanilla logic in EntitySelectorParser#parseSelector() is used.
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • fillSelectorSuggestions

      public static void fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionBuilder)
      This method is called in EntitySelectorParser#fillSelectorSuggestions(SuggestionsBuilder)