Command Filtering

Less checking, more doing.

You can also filter your commands and have the command bus automatically message the player about the issue. The event is never fired and you dont have to deal with handling simple things

List of filters

  • ArgumentRange(from, to)
  • ComsoleOnly
  • OperatorOnly
  • Permission("required.to.use.this)
  • Permissions("needs.this", "and this", ...)
  • PlayerOnly
  • Subcommands("must", "be", "ordered", ...)

Using Command Filters

Command filters are used as annotations above the command event

    @CommandFilter.PlayerOnly
    @CommandFilter.ArgumentRange({0, 1})
    @CommandFilter.Permission("plugin.god")
    public boolean onCommand(PhantomCommandSender sender, PhantomCommand command)
    {
        //This will only fire if the following match
        /*
         * The sender must be a player
         * The sender must have from 0-1 arguments
         * The sender must have the permission "plugin.god"
         */

        return false;
    }

results matching ""

    No results matching ""