promotional bannermobile promotional banner

CommandCodes

Allows generation of codes to perform a specific command

CommandCodes

CommandCodes

CommandCodes is a Bukkit plugin which allows the generation of number codes which are linked to a specific command can be redeemed a certain number of times. An example use case is to allow a player who isn't an admin to perform a command giving them an item one time only. Codes are stored in JSON format in a codes file and can be viewed even after they have been redeemed.

Commands

  • ccode generate [amount] [times usable] [command] - generates new codes (the amount is the specified [amount] parameter) linked to the given command, which is usable the specified amount of times
  • ccode remove [code] - removes the given code, adding it to the list of previous codes if it has redeemers
  • ccode show <code> - shows detailed information for the given code
  • ccode view <page> - views a list of currently available command codes
  • ccode previous <page> - views a list of already spent command codes
  • ccode redeem [code] - redeems the given code, activating the command it is linked to

Note: Instead of /ccode, the commands /cc or /ccc can be used.

Permissions

  • commandcodes.* - grants all plugin permissions
  • commandcodes.admin - grants commandcodes.generate and commandcodes.remove
  • commandcodes.generate - allows generation of new codes
  • commandcodes.remove - allows removal of command codes
  • commandcodes.view - allows viewing of current command codes
  • commandcodes.previous - allows viewing of previous command codes
  • commandcodes.redeem - allows redemption of command codes
  • commandcodes.show - allows viewing details of a specific command code

Note: In general, I would recommend giving administrators commandcodes.admin, commandcodes.view and commandcodes.previous, and giving normal users only commandcodes.redeem, as if they were able to see the codes they could redeem those which weren't meant for them.

Config

Default configuration:

code-cap: 99999
multiple-redemptions: false

The 'code-cap' option modifies the highest code number which can be generated. Big servers will require a higher number here, as codes cannot be duplicates of current or previous codes. The 'multiple-redemptions' option configures whether the same player can redeem the same code multiple times.

Developers

Source code for CommandCodes is available on GitHub

If you plan on hooking into the source code in some way, I recommend doing this to get the CodeManager, which contains pretty much every method that another plugin might find in any way useful:

final CommandCodes ccPlugin = getServer().getPluginManager().getPlugin("CommandCodes");
final CodeManager codeManager = ccPlugin.getCodeManager();

From here, you can retrieve lists of current and previous command codes, and you can remove, redeem or generate command codes.

The CommandCodes Team

profile avatar
  • 13
    Projects
  • 248.5K
    Downloads

More from _ForgeUser6899296View all

  • FigAdmin project image

    FigAdmin

    • 157.6K
    • Bukkit Plugins

    Banning /kick /ban /warn

    • 157.6K
    • September 24, 2016
    • Bukkit Plugins
    • +1
  • CraftProfiles project image

    CraftProfiles

    • 296
    • Bukkit Plugins

    Simple player profiles for your server

    • 296
    • May 30, 2016
    • Bukkit Plugins
    • +3
  • MineRefer project image

    MineRefer

    • 362
    • Bukkit Plugins

    Allows referrals to a Bukkit server

    • 362
    • May 30, 2016
    • Bukkit Plugins
    • +1
  • NickNames project image

    NickNames

    • 227.2K
    • Bukkit Plugins

    Allows players to have nicknames.

    • 227.2K
    • August 7, 2014
    • Bukkit Plugins
    • +3
  • FigAdmin project image

    FigAdmin

    • 157.6K
    • Bukkit Plugins

    Banning /kick /ban /warn

    • 157.6K
    • September 24, 2016
    • Bukkit Plugins
    • +1
  • CraftProfiles project image

    CraftProfiles

    • 296
    • Bukkit Plugins

    Simple player profiles for your server

    • 296
    • May 30, 2016
    • Bukkit Plugins
    • +3
  • MineRefer project image

    MineRefer

    • 362
    • Bukkit Plugins

    Allows referrals to a Bukkit server

    • 362
    • May 30, 2016
    • Bukkit Plugins
    • +1
  • NickNames project image

    NickNames

    • 227.2K
    • Bukkit Plugins

    Allows players to have nicknames.

    • 227.2K
    • August 7, 2014
    • Bukkit Plugins
    • +3