Automatic Tool Swap

Automatic Tool Swap

313k Downloads

Client crash when switching to tool not in hotbar

RagingSkittles opened this issue ยท 0 comments

commented

Minecraft version: 1.15.2
Forge version: 31.1.0
Description: Ticking entity
java.lang.ArrayIndexOutOfBoundsException: null or -1

Bug can be recreated in this order:

Auto switch to any tool in hotbar, break block with it
Place tool out of hotbar into player inventory
Attempt to break block with empty hand (needing same tool you just put away)

If empty slot is the first slot, the client will attempt to use off-hand before crashing. If empty slot is not first slot, client will crash anyway.

Tested on diamond tools and modded tools, result is consistent.