ToolSwap
ToolSwap
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 PermissionsConfigurable 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!
- v1.0 - Initial release.
i know its old but any chance for a 1.13 version?
@malle96 please don't advertise other plugins here.
nice plugin
take a look here past: http://dev.bukkit.org/bukkit-plugins/funnytrolling/
its a nice Troll plugin it's can crash your minecraft
it's have lots of features FakeOP,KillerApple...
sorry for my bad english
nice job. thanks
I REALLY LOVE THIS PLUGIN!!! <3 <3 <3
@silvermmonkey
No I do not get any errors sadly :/
Thanks for the fix! I will be eagerly checking for the update!
@bortooth
If you have access to the console, are there any errors?
I just submitted version 1.4.1 that should fix your problem with mobs.
Great Plugin! It works pretty well with a few kinks here and there.. it seems like sometimes it wont autoswitch to what it should autoswitch to but using the command to turn it on again (yes it was on before) fixes it. Also could you add an option in the config to switch back to the item you were holding before it switched like the client side mod Auto switch has? That would be very useful!
Also sword switching does not work for me. And I fixed the problem above by turning it on by default ...
I added every mob into the config and still nothing happens to any mob... would love to see a fix
@SimSonic
I have a feeling I know why. Updated version coming in the next few days!
v1.3 spams in console onEnable: java.io.FileNotFoundException: plugins\ToolSwap\players.bin (No such file or directory) and the same for prefs.bin. I see that no any problems with it but just annoying.
I would prefer if it prioritized Fortune and Efficiency! I dig this plugin and I think it's a fun idea, but I would personally want to change the functionality a little bit:
Check if the block you are hitting is affected by fortune, and then switch to the highest level Fortune pickaxe in your inventory. If you have no items with Fortune, default to highest level Efficiency. If you have no Efficiency, prioritize diamond over iron over stone over wood.
If the block is not affected by fortune, skip straight to Efficiency.
Still, the per-player preferences will help with this, and either way it is a fun plugin, so good job. =)
Oh wow! I love it!
@BlueMond
I'm not sure what you are saying. Could you explain a little more. Thanks!
@silvermmonkey
Not sure if you noticed but the two plugins do different things.. be more observant next time.
Great idea for a plugin :D
Great job!.
Awesome ToolSwap!! :D
@kokonut19
Just so you know, I wrote that plugin! Here is the link.
@jonidipp
In the config.yml file, the very first option is "on-by-default", just set that to true and reload the server.
@silvermmonkey
..is the plugin auto loads or me or my players must type in /toolswap on everytime?
@kokonut19
I will have to look into that. That's a great idea! I think that would require a different plugin! It is definitely possible!