Package net.glowstone.command
Class CommandTarget
java.lang.Object
net.glowstone.command.CommandTarget
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the value of a selector argument. -
Constructor Summary
ConstructorsConstructorDescriptionCommandTarget(org.bukkit.command.CommandSender sender, String target) Parses the target of the command with the given argument. -
Method Summary
Modifier and TypeMethodDescriptionThe arguments of the selector (target).org.bukkit.entity.Entity[]getMatched(org.bukkit.Location source) Gets all the matched entities from the target.net.glowstone.command.CommandTarget.SelectorTypeThe type of selector (target).
-
Constructor Details
-
CommandTarget
Parses the target of the command with the given argument. For example, a target could be "@r[c=5]", which would get 5 random players.- Parameters:
sender- the sender that used this target selectortarget- the un-parsed command target
-
-
Method Details
-
getArguments
The arguments of the selector (target).- Returns:
- the arguments of the selector of this target
-
getMatched
public org.bukkit.entity.Entity[] getMatched(org.bukkit.Location source) Gets all the matched entities from the target.- Parameters:
source- the location from which the targets should be found- Returns:
- the entities matching the query
-
getSelector
public net.glowstone.command.CommandTarget.SelectorType getSelector()The type of selector (target).- Returns:
- the type of selector of this target
-