Skip to content
Deximus-Maximus edited this page Dec 14, 2020 · 7 revisions

Welcome to the Fabric Autoswitch wiki!

client Fabric API

Important topics are in the sidebar.

What Autoswitch Does

Autoswitch (AS) reads the player's hotbar, and finds the best tool for the job currently available. (ie. you hit a stone block with your fist, it will switch to a pickaxe). These tools have some conditions that need to be satisfied:

  • Have more than 5 durability remaining configurable
  • Have the tool on your hotbar
  • Be capable of mining the block (awaiting changes to Fabric API, currently a dumb fallback is in place configurable)

Blocks

When attacking a block, AS checks a couple of things to see if it should proceed:

  1. AS is toggled on
  2. AS is allowed based on the player's current state and the configuration
    • creative mode
    • in multiplayer
    • allowed to switch for blocks
  3. Found relevant tools in the player's hotbar
  4. A relevant tool targets that block's material based on the Material Configuration
  5. Then the tool is switched, and if switchback is enabled, it will return to the previous slot when the player's hand is no longer swinging.

AS can be configured to recognize any registered enchantment.

Entities

When attacking an entity, AS will check for a few things:

  1. AS is toggled on
  2. AS is allowed based on the player's current state and the configuration
    • creative mode
    • in multiplayer
    • allowed to switch for entities
  3. Found relevant tools in the player's hotbar
  4. A relevant tool targets that entity's group* based on:
    • Boat -> Axe
    • Arthropods -> Weapons enchanted with Bane of Arthropods
    • Undead -> Weapons enchanted with Smite
    • Aquatic -> Tridents enchanted with Impaling If none of the above are satisfied, it will prefer weapons enchanted with Sharpness, if that is configured to be the case. Entity-specific overrides can also be used.
  5. Then the tool is switched, and if switchback is enabled it will return to the previous slot when the player's hand is no longer swinging, and (if enabled) the item's attack cooldown has passed. It is highly recommended you leave this enabled as otherwise would prevent weapons from doing full damage against an entity.

AS can be configured to recognize any registered enchantment.

*Note

See Minecraft Wiki for details on entity groups. Group names are not exactly the same between the wiki and what Fabric uses.

Other

If a mod's tools do not work automatically, tell the mod author of that mod to add their tools to the proper FabricToolTags. Some mods may require other changes to function