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.
Does this work on the new Bukkit version?
Awesome Plugin!
fith
FOURTH
Third
dcssfdsfsfffffffffffffffffffffffffffffffffffffffffffffff
@lukecfairchild
Sure, sounds simple enough and I can see the need for it. It will most likely be a config.yml option.
It will probably only affect commands entered on the command line, though. Will this be ok?
Global power tools will still have to be entered with the first slash omitted. Automatically saved power tools (if you ever edit those) will be the same.
Or I can make the new option change all interpretations of commands... but toggling the option will not automagically convert global/saved power tools. Just seems like too much work for such a small feature at this time. :P
I have a tiny request. Maybe make it a option in the config. But I like actually putting in the / when entering a command. Currently we do something like this: /pt left warp spawn
I was wondering if you could make it so you can just paste the whole command as is:
/pt left /warp spawn
I know there is no real need for it, I just like it more that way. And yes I also know that it would require WorldEdit commands to have / /. Just a thought. Let me know what you think.
BTW, a new dev version is up, if anyone is willing to test. It supports the subtypes of wood, wool, etc.
See here for details.
Awesome feature to add. Make it so that we can bind multiple (3 or more) commands to one item. Heres how it would work. You make a list of commands for the item with /pt <command>. Then, to scroll through the commands you use left click and it tells you in chat which command you have on your item. I need this because I hate having to fill my inventory with a bunch of useless items for my commands.
It's an awesome plugin I need for my server. But could you add a method to bind the item which has different type like wool or custom items added by spout?
@ZerothAngel
Thanks for responding and also updating your plugin! It works perfectly for the spawnmob command now, except for a tiny detail. When I first bound the tool to use the command, I kept getting the No Players Matched Query message from CommandBook. It only corrected itself when I logged out and logged back in again.
It's not a big deal, but I thought you might want to look into it!
Thanks for a great plugin!
Thanks man I'll give it a go
New dev build up: http://ci.tyrannyofheaven.org/job/PowerTool-standalone/lastSuccessfulBuild/org.tyrannyofheaven.bukkit$PowerTool/
Should no longer need /runalias with CommandHelper. Might fix your problem, lukecfairchild.
The data values/wool colors and item consuming features are on my radar, but they're far bigger changes (especially the former) and I've been pretty busy lately. Hopefully within a week or so...
@lukecfairchild
The problem is actually because CommandHelper intercepts commands at such a low level - that's why you have to use CommandHelper's /runalias command to run CH aliases from PowerTool.
I'll have a look at executing commands at the same level as CH. I'll probably make it an option, so I don't inadvertently break something for someone else.
Hey man another request. Could you make the command execution not quite so low level. That way plugins like commandhelper can pick it up. Because the problem i am having now is. I do alterations and stuff to commands or turn them off using commandhelper, but then powertools allows them to bypass that all together. Possible?
This is a fantastic plugin and it helps me a lot on my server but this is the only plugin close to what I am after. Is there a way that you can put more then one command on 'right-click' and is there anyway that you could put a thing in that allows you to delete the item when you use the commands on it but you could change it around on an other item so that you keep the item after use. This would be fantastic if you could implement this into the plugin and of you do then you will be the plugin god because this is the only plugin that that is close to anything that I need that I can find. Thanks again for the amazing plugin.
I have been mourning the loss of a similar plugin (http://hatsonmadmen.blogspot.com/2012/03/timesink-part-9-requiem-for-plugin.html) and am super glad this exists. Frankly, this one is easier to use.
Thank you, thank you, thank you for helping me make the server I run have a more natural minecraft-like interface and giving players a way to type less and play more
Honestly, I don't know why something like this isn't a must for every server.
is there a like button i can press
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND