PowerTool
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. (Haspowertool.use.*
andpowertool.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 bothpowertool.use.golden_apple
andpowertool.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.
- PowerTool (Requires ToHPluginUtils.jar)
- PowerTool-standalone (includes ToHPluginUtils, like the version distributed on dev.bukkit.org)
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.
Can you add an option to the plugin: let's say player has one bone, that bone has a power tool that heals the player. When player uses it the item will disappear from the player's inventory.
when I try to do /powertool list it thinks that i am trying to bind /list to my hand.. I have a lot of powertools and i want to use them on a day to day basis.
Is it possible to set a cooldown time on the tool?
is this for mc 1.6.4?
So I want to use an emerald so if players click on it they will get the shop gui,but players can click on any powertool only once without having to remove the emerald from their inventory and reload the server. Is there a way i can allow players to click on it multiple times?
How to make use the command for single use?
Can you set multiple commands to only left click?
@NewGamer591
it still work for me :)
whats the mod called
this does not work any one I type in it says not found
AW YEAH
Is it possible to have a item named something else and have the only work with the name of the item and not the item itself. So if you used the powertool for a wooden shovel named LightningRod it would only work for the wooden shovel with the name LightningRod and not just an ordinary wooden shovel?
How much ram does this plug in use up in a minecraft pro hosting server?
Hi. I love this plugin, i turned every music disk into a spell. But is it possible to bind more than one command to a right click. i want to set off redstone torches to /take 75 1 (I have the /take command plugin) and /i 369 1 and /ee 16 10 /ee 20 10 /ee 34 10 (I have Endless Enchants) I want to make a lightsaber that opens from a off redstone torch to a fiery, unbreaking, sharp lightsaber (blaze rod) and the blaze rod will give you an off redstone torch, or does another plugin do this. Thanks.
)=
Sorry man. I didn't mean to make you feel that way at all. I wasn't trying to sound like an ass. You asked what was special about books and how I would go about multi-line commands so I "continued on with more details" because I thought that is what you were asking for.
And about the ticket thing: I am kind of dumbass. Sorry.
If you want, I can repost these as tickets (and delete the comments) or just shut up now...
@SanguineScythe
Not sure whether or not I should feel patronized there.
In our PMs, I asked you to add your requests as tickets. And even after you put them here, in the comments, I pointed you to 2 tickets that request the same features. And yet you continued on with more details, here in the general comments section where they'll probably get lost by the time I get to them.
Anyway, thank you for your ideas, but sorry, I don't have time to work on this plugin right now.
@TheGoldenCreepr
"delay: delaytimeinseconds"
Great minds think alike.
Also, just let me know if that is too much, Zeroth. I could give you them one at a time or what not.
Can you add a cooldown?
Sorry for probably being overwhelming.
I love you man.
Also, you should add a token for the player who issued the command. Some commands won't work otherwise with "run-as-console" on.
So the perfect setup for the global power tools config for me would be this:
Example:
(Teleport home scroll that is removed on use. Heal other spell book that can be used every 10 seconds.)