Topic category: Help with modding (Java Edition)
I am attempting to make a procedure to swing the off hand of the player if the player is holding the same specific weapon in both hands, like when the player swings one weapon, the one in the offhand swings too (merely a visual tweak, the actual benefits of dual wielding the weapon are purely potion effects). Essentially the procedure works like this: In the weapon/tool's menus, I set this procedure to trigger when the weapon is swung. The procedure checks if the player has the same weapon in their offhand, and waits two ticks to then perform a visual off hand swing (making it swing at the same time crashes the game). The issue arises here, as now that the offhand swings, the procedure triggers again, as now the player has effectively swung the weapon again. The procedure then performs an infinite loop, the offhand swinging as if on repeat. Any idea how to fix this?