Auto Tool Switcher - swaps the tool in a players hand depending on what block/entity that player interacts with. See below for details on tool swapping. Version: v1.4.1
UPGRADE NOTE
REQUIREMENT: When upgrading to v1.4 or higher from a version lower than 1.4, you must delete the "ToolSwap" folder inside your plugins folder. BE SURE TO BACKUP YOUR CONFIG.YML IF YOU MADE CHANGES, ALSO YOUR PLAYER'S PREFERENCES WILL BE DELETED!
If you are using ToolSwap v1.2, you need to delete the "ToolSwap_v1.2.jar" file from your plugins folder before upgrading to v1.3 or higher.
Do you want your blocks automatically refilled from your inventory when you place the last one of that type? See AutoRefill
Video
Installing & Upgrading
Download ToolSwap.jar
Drag ToolSwap.jar into your "craftbukkit/plugins" folder - replace ToolSwap.jar when upgrading.
For updates that include new blocks, either delete config.yml in the ToolSwap folder, or be sure to add the new blocks to your config.yml file.
Configuration
ToolSwap may be configured from the default settings.
You Can:
Turn ToolSwap on or off by default
Turn torch swapping on or off
Allow ToolSwap to swap to sword when a player hits another player.
Change which blocks/mobs will activate ToolSwap.
Important Notes:
Navigate to the "config.yml" file in the "craftbukkit/plugins/ToolSwap" folder. If the file or folder is not present, reload the craftbukkit server.
Only use space characters in the config.yml file. Tabs will break it!
Blocks must be specified by their material name. These values can be found here.
Mobs must be specified by their entity type. These values can be found here.
Craftbukkit must be reloaded before any changes to the config.yml file can take place.
Commands
ToolSwap is very simple to use!
/toolswap [on/off]- this turns ToolSwap on or off.
/toolswap [player] [on/off]- this turns ToolSwap on or off for the specified player.
/toolswap [set]- this turns ToolSwap into listening-mode. The next block a player hits with a tool, will set the preferred tool for that block to that tool.
/toolswap [cancel]- this cancels listening-mode.
/toolswap [list]- this brings up a list of a player's preferred tools.
/toolswap [del/delete] [number]- this removes the preferred tool list item at the given number.
Please note that ToolSwap is disabled by default.
Permissions
toolswap.* - enables all permissions.
toolswap.use - ToolSwap may be used by this player. Note: ToolSwap must be turned on first (either by using a command or by enabling "on-by-default" in config.yml).
toolswap.on - enables use of "/toolswap on" command.
toolswap.off - enables use of "/toolswap off" command.
toolswap.player.on - enables use of "/toolswap [player] on" command.
toolswap.player.off - enables use of "/toolswap [player] off" command.
toolswap.pref- enables players to set preferred tools, gives playes access to "/toolswap [set/cancel/list/delete]" commands.
Swapping
The Right Tool for the Job
ToolSwap - When a player left-clicks on a block that can be mined, ToolSwap will determine if the correct tool exists in that player's inventory. If so, the item in-hand will be swapped with the correct tool in that player's inventory.
Auto-Torch - When a player has a pickaxe or shovel in-hand, and right-clicks a block that a torch can be placed on, ToolSwap will determine if torches are in that player's inventory. If so, the item in-hand will be switched with the torches in that player's inventory.
Fighting - When a player left-clicks on an enemy mob, ToolSwap will determine if a sword is in that player's inventory. If so, the item in-hand will be swapped with a sword.
Tool Breaking - If a tool breaks while ToolSwap is on, ToolSwap will swap to the next available correct tool in that player's inventory.
Multiple Tools, Not a Problem
Let's say that a player clicks on a cobblestone block, and has multiple pickaxes in their inventory, how does ToolSwap determine what pickaxe to switch to?
When swapping, ToolSwap will find the first correct tool in that player's inventory:
Order of First to Last
The 'HotBar" from left to right.
The rest of the player's inventory from left to right, top to bottom.
This means that the left-most slot in the "HotBar", is the first item in a player's inventory. The item in right-most slot on the bottom row of a player's inventory is the last item in a player's inventory.
Special Cases
When a player has a bow in-hand, and that player clicks on a block that can be mined, ToolSwap will not swap to the correct tool for mining. However, if the player has a bow in-hand, and that player clicks on an enemy mob, ToolSwap will swap to the first sword in that player's inventory.
If ToolSwap swaps an item in a player's "HotBar," instead of swapping the items in the bar, ToolSwap will change the selected slot of the correct item. This makes players that are particular about their "HotBar" inventory quite happy.
Some ores/blocks require a certain level of pickaxe to mine, ToolSwap will only swap to the required level (or higher) pickaxe needed to mine that ore/block.
Metrics
This plugin utilizes Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
A unique identifier
The server's version of Java
Whether the server is in offline or online mode
The plugin's version
The server's version
The OS version/name and architecture
The core count for the CPU
The number of players online
The Metrics version
Future Releases
Add Permissions
Configurable Preferences - set which tools to use on which blocks.
Per-player Preferences - player's can set the tool in-hand as the preferred tool to switch to, when mining specific ores/blocks.
Credits
Author: silvermmonkey A.K.A. mmonkey
Testers: Desaxt01, GrahamCracker4m, HuskerMath and e_dick.
ChangeLog
v1.3 - Per-player preferred tools! New commands and permissions! Added MCStats!
v1.2 - Updated for Bukkit 1.7.2!
v1.1 - Added permissions, configurable settings, and more commands!