Closed Vashal0 closed 2 years ago
Oh boy that's weird 😄
... @desht halp? :D
Interesting. I'll do some debugging, but I might just need to blacklist villagers from being interacted with...
So I did some testing, and I can see the hopper pull items from the villager's hand (which is expected - getting the item capability handler for a villager on a vertical axis gets the 2-slot hands inventory of the villager).
But I definitely don't see any change to the stack size of the traded item in the trade gui (and stepping through with my IDE debugger doesn't give any indication that this should happen - it's just pulling items from the villager's hands, that's all). It's possible some other mod is having an effect here, perhaps?
Oh no, that's gonna be impossible to track down 😅 thanks for debugging this!
By any chance when you did your testing, did the villager have two in stock trades for emeralds? I tried to reproduce it with different villagers, and found some things that may help you track things down.
If a villager has only one trade for emeralds, AND the item is naturally a single item(i.e. emeralds for pumpkin pie), the hopper takes it nothing happens. If a villager has two in stock trades for emeralds, the villager will rotate between the items and the bug will occur eventually, takes longer to happen with multi item trades (i.e. emeralds for 6 bread), speed upgrades in the hopper make it happen sooner If a villager has only one trade for emeralds, AND the item is naturally a single item, and you swap the emeralds back and forth from your hand after the item is taken, the bug activates.
Easy to test with villagers are PNC villagers, which always have two for-emerald base trades, farmer which has a multi item trade early(bread), and butcher which has a reliable 1 for-emerald trade early(rabbit stew)
OK, managed to reproduce it - thanks for the pointers.
As for why... no idea :( I can try to debug further, but I feel like excluding villagers from this is the best option. It's a bit exploity even when not bugging out.
Wonder if you'd consider making that blacklist a tag actually.
It's not a big deal for E6, but I could see people wanting to blacklist things like raccoons from Alex's mobs.
Yeah, probably a good idea!
these are blacklisted by default in PNC now.
Modpack Version
1.3.0
Describe your issue.
Placing an omnidirectional hopper with an entity tracking upgrade under a villager, and then holding emeralds in your hand will take the item that they show. In addition, the trade for the item that they show's stack size will increase each time until max stack size.
Placing a chest under the hopper, or any other inventory, causes the items to instead decrease in stack size strangely enough, removing the trade from the villager entirely so they just trade emeralds for nothing at all
Crash Report
No response
Latest Log
No response
Have you modified the modpack?
No
User Modifications
No response
Did the issue happen in singleplayer or on a server?
Singleplayer