Class CommandTarget

java.lang.Object
net.glowstone.command.CommandTarget

public class CommandTarget extends Object
  • Constructor Details

    • CommandTarget

      public CommandTarget(org.bukkit.command.CommandSender sender, String target)
      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 selector
      target - the un-parsed command target
  • Method Details

    • getArguments

      public HashMap<String,CommandTarget.SelectorValue> 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