Severing and other loot modifiers don't apply when using an item in the offhand
katietheqt opened this issue ยท 5 comments
Minecraft Version
1.18.2
Forge Version
40.2.0
Mantle Version
1.9.54
Tinkers' Construct Version
3.7.2.167
Describe your issue
When using an item in the offhand, Severing and other loot modifiers don't apply unless you are also holding a Tinker's tool in the mainhand. This is because the required loot modifier requires the mainhand item or used tool to be a Tinker's tool, but neglects to check the offhand.
The fix should be like one line so I haven't submitted a PR as it would probably be more work than a core developer fixing it manually, but if it would be helpful I can submit one.
Crash Report
No response
Other mods
N/A (issue occurs with only Tinker's Construct installed)
Tried reproducing with just Tinkers?
Yes
Does this issue affect Tinkers' Construct in 1.19.2?
Yes
Performance Enchancers
None of the above
Searched for known issues?
Checked pinned issues, Searched open issues, Searched closed issues, Checked the FAQ, Checked the in game books
Simply checking both hands is not the right fix, as that just means holding a severing tool in the offhand makes the mainhand better. Better fix would be to reuse our hack from looting to make severing function; we wrote that hack long after severing was coded so I just never considered it there.
Checking both hands is the right fix I believe? This just an optimization from what I can tell - if you ran it always it should still work, but there would be a performance hit.
(the implementation of the modifier hook class already uses the hack)
Checking both would be a major API break as modifier hooks are not expecting to be potentially run twice on loot happenings. And more importantly, modifier hooks shouldn't run when they are not the hand used to kill the monster. The fix is not as simple as checking both, it requires careful consideration to ensure modifiers know what they are signing up for.
I think you are misunderstanding - I am only proposing changing the condition to execute the modifier_hook
loot modifier to check if either hand is a tinkers item. This does nothing except fix the bug, as the loot modifier itself is doing the correct thing - it just doesn't get the chance to run if the mainhand item is not a tinkers tool.
You can demonstrate this by holding a severing tool in the offhand - it won't apply when used to kill mobs, unless you hold any tinkers weapon in your mainhand. The mainhand weapon doesn't get the severing buff either. The issue is simply that the modifier itself doesnt get the chance to execute in the mainhand-empty case.