Class EntitySelectorManager
- java.lang.Object
-
- net.minecraftforge.common.command.EntitySelectorManager
-
public class EntitySelectorManager extends java.lang.Object
Allows modders to register custom entity selectors by assigning anIEntitySelectorType
to a String token.
The token "test", for example, corresponds to @test[...] in a command.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.HashMap<java.lang.String,IEntitySelectorType>
REGISTRY
-
Constructor Summary
Constructors Constructor Description EntitySelectorManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionBuilder)
This method is called inEntitySelectorParser.fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder)
static EntitySelector
parseSelector(EntitySelectorParser parser)
This method is called inEntitySelectorParser.parse()
If the REGISTRY does not contain a custom selector for the command being parsed, this method returnsnull
and the vanilla logic inEntitySelectorParser.parseSelector()
is used.static void
register(java.lang.String token, IEntitySelectorType type)
-
-
-
Field Detail
-
REGISTRY
private static final java.util.HashMap<java.lang.String,IEntitySelectorType> REGISTRY
-
-
Method Detail
-
register
public static void register(java.lang.String token, IEntitySelectorType type)
- 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 inEntitySelectorParser.parse()
If the REGISTRY does not contain a custom selector for the command being parsed, this method returnsnull
and the vanilla logic inEntitySelectorParser.parseSelector()
is used.- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
fillSelectorSuggestions
public static void fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionBuilder)
This method is called inEntitySelectorParser.fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder)
-
-