What Autoswitch Does
Autoswitch (AS) reads the player's hotbar, and finds the best tool for the job currently available based on the config files (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 3 durability remaining configurable
Have the tool on your hotbar
Be capable of mining the block (a naive fallback is in place for mining levels configurable)
It is aware of tool enchantments
AutoSwitch is fully configurable. The config files detail their specifics at their top, and each option is documented within the file. A hotkey is available to quickly toggle switching on or off, along with a toggle command.
Blocks
AS checks the block's Material*, or the specific block's id if it is present in the config file, and will evaluate the tools based on the configuration.
*Note
See the Minecraft Wiki for details. The names used in the config files are the same as the names Fabric uses, which differ from the names on the wiki. Each material is documented within the config file.
Entities
AS checks the entities group*, or the specific id if it is present in the config file, and will evaluate the tools based on the configuration. Bases weapon choices in part on the amount of damage the tool can do.
*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. Autoswitch provides an API by which mod authors can create their own tool groups similar to the provided pickaxe, axe, etc.-
In reply to Mahawailoh:
Which versions of AS and MC are you using?
Edit: What kind of lag?
In reply to Deximus_Maximus:
I am using 1.19.2 and the latest fabric release of AS. The lag that I am referring to is a huge fps drop when pressing either of the mouse buttons and makes the game extremly choppy. The lag disappears once buttons are not pressed or when AS is disabled.
In reply to Mahawailoh:
Every time pressing the mouse buttons are pressed, or only on blocks/mobs? When AS is disabled, do you mean you toggled switching off ingame, or removed the mod?
Do you have any other mods installed?
In reply to Deximus_Maximus:
toggling on/off ingame, only on blocks and entities, even when no action is performed ( for example holding right click with bare fists on any block )
I have a lot of optimization mods installed, UI/Visual mods and other minor vanilla enhancing mods
In reply to Mahawailoh:
I haven't been able to reproduce this with just AS and FAPI. Could you provide a log, or if it's not too much trouble use the spark profiler mod to produce a profile when the lag occurs?
In reply to Deximus_Maximus:
sure, I got you. https://paste.centos.org/view/f19ca76b
In reply to Mahawailoh:
Well, the problem seems to be log spam - something is printing "false" to the log - and a lot of it.
Problem is that it doesn't seem to be autoswitch, so we might have a weird mod interaction going on. I'll try recreating your modlist to see if I can reproduce it.
Please try with AutoSwitch 5.4.6, I want to make sure everything is in its most up-to-date state at least for AS.
So I tried configuring AS so that it would use silk touch pick on ores using the example given in the Wiki: block@c:ores = pickaxe;minecraft!silk_touch but changed this as follows to match the other items in the config file: block@c:ores = pickaxe;minecraft:silk_touch
Crash!
Can someone help me figure out the config settings to differentiate ores from stone and use silk touch for ores?
Update: Now I can prevent crashing, but cannot get silk touch to auto select for ores. My config looks as follows:
stone = pickaxe;minecraft:fortune, pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
block@minecraft\:ores = pickaxe;minecraft:silk_touch, pickaxe;minecraft:fortune, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
Update 2:
I have also tried this variation: block@c\:ores = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
I have also tried changing the order of the items in the config file. Regardless of what I change in the config file, it always chooses the fortune pick over the silk touch for both stone blocks (stone, deepslate) and for ore blocks.
In reply to duhbetter:
Well, I was hoping for a simpler solution, but I did figure out how to make ore mine with silk and stone (and variants) mine with fortune (non-silk touch). In case anyone needs to do this, here are all 19 lines for the autoswitchAttackAction.cfg (18 for all ore variants, and 1 for stone variants):
coal_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
copper_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
diamond_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
emerald_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
gold_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
iron_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
lapis_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
redstone_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
nether_gold_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
nether_quartz_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_coal_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_copper_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_diamond_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_emerald_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_gold_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_iron_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_lapis_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
deepslate_redstone_ore = pickaxe;minecraft:silk_touch, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
stone = pickaxe;minecraft:fortune, pickaxe;minecraft:mending, pickaxe;minecraft:efficiency, pickaxe
Still interested in a more concise config entry to make this work. Thanks!
In reply to duhbetter:
Fixed in 5.4.4
Wiki is now fixed to have a valid config entry.
Sorry for the trouble.
In reply to Deximus_Maximus:
Thank you so much!
I love this mod and have been bragging about it to fellow SMP players.
In reply to duhbetter:
Thanks for the support!
The 5.4.0 version won't work for me. The MC launcher crashes with an error. The previous version, 5.2.2 works just fine.
In reply to ClassicChad76:
Fixed in 5.4.1
works great.
This seems to "work" in 1.19.2
Hi, is there a way to make it so that when my totem activates it swaps my selection to another totem in my hotbar? I've gotten into some sticky situations in my hardcore world where this would be super helpful.
Thanks for your time.
In reply to exodus007xd:
This is not currently possible, but may be included in 5.2 or 5.3.
Great mod, a couple of things tho
#1) My Razer auto clicker stops working when this mod is installed, I use it for big wall structures when building up
#2) Can't figure out how to use the block auto switcher
#3) I often use the first 3 slots in inventory on top of the Hotbar for tools too, it would be cool if it could grab them for me... I reckon it would be a bit janky to do that tho
In reply to Z3dan:
1. I've gotten this report before. I do not have that program, and do not know why it is having issues.
2. what do you mean?
3. The current mod does not move items. While this feature was previously rejected outright, I am more open to it, but it needs a lot of design to be something nice.