Offhand support for auto loot feature.#5
Conversation
| "CHAINMAIL_BOOTS"); | ||
| } | ||
|
|
||
| public static boolean isOffhandItem(ItemStack itemStack) { |
There was a problem hiding this comment.
Is it always this? Can't you also hold something else in the off-hand?
I'm thinking about the dualwield plugin I forked. So then you'd be able to hold an axe or sword in your offhand.
Isn't there a better way to do this? I mean: maybe it's possible to store (as underneath it's using SQLite) the order of items? And as such, also store armor/hand/offhand data?
Do you think it's possible to do it that way?
There was a problem hiding this comment.
I'm sure that it would be much better to use SQLite to store the items properly however, I believe it would require a decent change to the way that the graves store the items.
I don't really have the time to implement those changes properly, and this was kind of just a bandaid fix to just get the idea out, mostly for personal use, in the hopes that someone else will expand upon it (in a hopefully much smarter way than I can).
(While writing this out, I realized that it probably would have been better to just make a feature request rather than make a weak attempt at implementing it)
There was a problem hiding this comment.
If you allow me to write to your branch, I will have a try today. Or I just fork your fork 😎.
|









It will check to see if there is a shield or torches in the grave and attempt to place them in the offhand slot. It will not place an item in the slot if it has any items before looting.
Fixed my mistake of not including
isOffhandItem()in theInventoryUtilclass.