PowerTool

This project is abandoned.

Whether this project is out of date or its author marked it as abandoned, this project is no longer maintained.

If you wish to take this project over, please report it and state your intentions.

PowerTool — Bind commands to items

Originally requested by InflamedSebi in this thread.

PowerTool allows you to bind commands to your in-hand items. Any item may be assigned commands for both left-click and right-click. Bound commands remain until you manually clear the binding.

Please post bugs and/or feature requests as dev.bukkit.org tickets.

Features

  • Bound commands may include special tokens which are appropriately substituted when the item is used. Currently, these are:
Token Description
%p The name of the player you left-clicked or right-clicked.
%x X-coordinate of the block targeted by your crosshairs
%y Y-coordinate of the block targeted by your crosshairs
%z Z-coordinate of the block targeted by your crosshairs
%Y Y-coordinate of the nearest air block above the block targeted by your crosshairs

All of these tokens are configurable.

  • Works in creative mode. Right-clicking and left-clicking players in creative mode will generally work, even when far away (up to 100 blocks).

  • Ability to define global power tools. These are administrator-defined binds that can be made available to whoever you want (based on permissions).

  • Fine-grained control over the use of power tools via permissions.

  • Global power tools may grant temporary permissions or even be run as the console. Needless to say, these features should be used with care.

  • The number of player-created binds may be limited based on group/permission.

  • Items may be further differentiated by custom display name (e.g. when given one via Anvils). Note this option is off by default, enable it in the configuration file.

Commands

There's only one command, /powertool which may also be abbreviated /pt or /ptool:

  • /powertool left <the-command-to-bind> — Binds the command (and its arguments) to the left-click action of the current item. The command must not include the first slash. This may also be abbreviated as /powertool l.
  • /powertool right <the-command-to-bind> — Binds the command (and its arguments) to the right-click action of the current item. This may also be abbreviated as /powertool r.
  • /powertool left — With no command to bind, the currently-bound left-click command is cleared from the current item. Use /powertool right to clear the right-click command.
  • /powertool list — Displays all player-defined power tools for the current player.
  • /powertool clear — Clears all bound commands from the current item.
  • /powertool clear <item-id-or-name> — Clears all bound commands from the specified item.
  • /powertool clear -a — Clears all bound commands from all items.
  • /powertool on — Enable power tools for this session (default is on).
  • /powertool off — Disable power tools for this session.
  • /powertool toggle — Toggle power tools availability. Can also be abbreviated as /powertool t.
  • /powertool reload — Re-reads config.yml.

Permissions

PowerTool only supports Bukkit permissions (aka Superperms). By default, ops have all permissions.

  • powertool.use — Allows the use and creation of power tools. (Has powertool.use.* and powertool.create as child permissions.)
  • powertool.use.* — Allows the use of all power tools.
  • powertool.use.<item-id> — Allows the use of a specific power tool identified by item-id. item-id may be numeric (e.g. 322 for golden apple), or the Bukkit Material name with or without underscores (e.g. GOLDEN_APPLE or GOLDENAPPLE). Note that Bukkit permissions are not case-sensitive, so both powertool.use.golden_apple and powertool.use.GOLDEN_APPLE work fine.
  • powertool.create — Allows the creation of personal power tools. A player must be given this permission in order to use the left/right/list/clear subcommands.
  • powertool.reload — Allows use of /powertool reload

Additionally, per-group power tool limits may be defined using permissions. See the options section in config.yml for details.

Global, Administrator-defined Binds

By editing config.yml, the server administrator can define binds for use by anyone with the powertool.use permission.

For example:

powertools:
    string:
        left-click: plugins
        right-click: version

The item ID ("string" in the above example) may be an integer item ID or a name. If using an integer item ID, you must quote it as a string, e.g. '287' for "string." If using a name, you must use a standard Bukkit material name (found here). For example, for golden apples, you may use one of:

  • GOLDEN_APPLE
  • 'golden apple' (since it has a space, it must be quoted)
  • goldenapple

Examples

  • Promote and demote users using the left-click and right-click actions of the current item:

    /powertool l promote %p

    /powertool r demote %p

  • Bind WorldEdit's copy & paste commands. Remember that many WorldEdit commands normally start with two slashes, but you must always omit the first slash.

    /powertool left /copy

    /powertool right /paste

License & Source

PowerTool is released under the Apache License, Version 2.0.

Sources may be found on GitHub:

Development builds of this project can be acquired at the provided continuous integration server.
These builds have not been approved by the BukkitDev staff. Use them at your own risk.

To Do

  • Allow setting/clearing global power tools from the command line (for those with the proper permission, of course).
  • Allow player-specific power tools to override global ones.
  • Allow global power tool flags (e.g. run-as-console) to be assigned to each individual action.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of DannySan626 DannySan626 Jun 12, 2014 at 05:48 UTC - 0 likes

    Someone NEEDS to take this up and update it. And keep it updated at the same time.

  • Avatar of sunny40universe sunny40universe May 29, 2014 at 14:17 UTC - 0 likes

    @some100: Go

    No you don't use /powertool you use /pt

  • Avatar of some100 some100 Apr 17, 2014 at 17:49 UTC - 0 likes

    When I do /powertool left fireball it do not work.

  • Avatar of aragon1416 aragon1416 Apr 12, 2014 at 10:34 UTC - 0 likes

    Is there an option where players who DON'T have the permissions to do the command can still use the powertool. (in this case, i have tied the /fireball command to a block BUT they cannot use the powertool unless they have the permission AND I DON'T want them using the fireball command anywhere else e.g. spawn!)

  • Avatar of aiden280zx aiden280zx Feb 06, 2014 at 05:21 UTC - 0 likes

    how do i set is as a command on all of one item i would like the copy of what i type in to the config?

  • Avatar of darthluke72 darthluke72 Jan 05, 2014 at 19:49 UTC - 0 likes

    Can you powertool other people's items?

  • Avatar of TFCrysis TFCrysis Jan 03, 2014 at 17:17 UTC - 0 likes

    A few suggestions:

    Add a consume variable, as to where if one person right cliks a blaze rod with the strength command it then disappears.

    Create an option to hide the commands when you go over then on your hotbar, I do not want players to see these and I'm sure others would agree.

  • Avatar of Remi_Scarlet Remi_Scarlet Dec 20, 2013 at 04:56 UTC - 0 likes

    @rex285: Go

    It's player-specific. They have to make the powertool command on their own unless you define a global one in config.

  • Avatar of rex285 rex285 Nov 29, 2013 at 18:56 UTC - 0 likes

    Ok, i added this to my server and i am useing it for when players right click an item it opens a menu, I added the right click command but only i have it other players it wont work for them for some reason and i tried everything how can i make it work for all players instead of just me? And it's not a permission thing, they dont have it?

  • Avatar of ReecesPiec3s ReecesPiec3s Nov 24, 2013 at 21:13 UTC - 0 likes

    Global power tools may grant temporary permissions or even be run as the console. Needless to say, these features should be used with care.

    So, how do I make them grant temporary permissions or run it through the console?

Facts

Date created
Oct 03, 2011
Category
Last update
May 05, 2013
Development stage
Abandoned
Language
  • enUS
License
Apache License version 2.0
Downloads
37,017
Recent files
  • B: 0.9.10 for CB 1.5.2-R0.1 May 05, 2013
  • B: 0.9.9 for 1.5.1 Mar 23, 2013
  • B: 0.9.8 for CB 1.4.7-R1.0 Feb 16, 2013
  • B: 0.9.7 for CB 1.3.2-R3.0 Jul 01, 2012
  • B: 0.9.6 for CB 1.2.5-R1.0 May 06, 2012

Authors