AutoSwitch
by dexman545
With AutoSwitch installed, the active tool changes on its own when the player attacks or interacts with a block or entity.
What it does
Each target a player hits or uses can be mapped to a tool. The mod checks the target against rules set in its config file, picks the highest priority match that has a usable tool, and switches the hotbar to that tool. A stone block can bring up a pickaxe, and a gravel patch can bring up a shovel. The tool picked depends on enchantments on the tool, the target's block state, or an entity's equipment.
Rules are written in a HOCON file named autoswitch.conf, found in the config folder next to the resource pack folder. The file has three sections for defining selectors and targets for attack, interact and stat-change actions, and one section for general behavior. The mod can be turned on and off in game with the R key, which is the default.
AutoSwitch requires Fabric API on Fabric. It is published for Fabric and NeoForge across 38 release versions, 1.16 – 26.3, and is a client-side only mod, so servers do not need it. The code is under the GNU Lesser General Public License v3.0 only and is open source.
Key features
Attack and interact rules
Separate rule sections cover attacks on entities or blocks and right-clicks on them, each with its own targets and tool lists.
Priority ordering
Rules carry an integer priority, and the highest value wins when several targets match the same action.
Expression targets
Targets can combine with AND, OR, NOT and XOR, nested to any depth, so rules can describe detailed conditions.
Enchantment and equipment matching
Selectors can check item enchantments, block states, potion contents or the equipment an entity wears.
Player condition checks
Rules can depend on the player's state, such as crouching, riding, or standing a set distance from the target.
Compatibility
Latest build for each game version and loader.
26.x5 of 5 versions with builds
1.21.x12 of 12 versions with builds
1.20.x6 of 6 versions with builds
1.19.x4 of 4 versions with builds
1.18.x3 of 3 versions with builds
1.17.x2 of 2 versions with builds
1.16.x6 of 6 versions with builds
This mod also publishes snapshot builds. Snapshots are not shown in the matrix.
Requirements
Dependencies declared by the latest file for each loader.
Required 1
Use cases
Mining and digging
Switching to the right tool for each block saves manual hotbar changes while clearing terrain or mining ore.
Combat with mixed mobs
Rules can select a weapon based on the entity hit or on its equipment, such as a saddled pig needing a different tool.
Who it’s for: Players who switch tools often in survival and creative worlds, and players who want to script their own tool rules through the config file.
Questions
Does AutoSwitch need Fabric API?
Do servers need AutoSwitch installed?
How are the tool rules changed?
In the catalog
AutoSwitch is one of 36,990 Utility mods on ModsFinder, and one of 25,772 Utility mods for Fabric. 8,071 mods support Minecraft 26.3.
More from dexman545
Similar mods
What the author says
AutoSwitch is a Minecraft mod available on Fabric and NeoForge for automatically switching the active tool to the correct one when attacking or interacting with blocks or entities - you attack a stone block, it switches to a pickaxe, then when you hit an annoying gravel patch it switches to a shovel. Which tool is…
Official listing
- Modrinth page
- modrinth.com/mod/autoswitch
- Owner
- dexman545
- Published
- 2020-12-14
- Updated on Modrinth
- 2026-09-15
- Facts verified
- 2026-10-15
