Jakob99 Posted October 29, 2017 Posted October 29, 2017 I can't seem to figure out how to swap items in inventory so that the server recognises that i did. I read some other forum posts that you need to send packets, but I can't seem to figure them out. I would apreciate if anyone could tell me what packet i need to send and how to do so. Thanks in advance, Jakob99 Quote
Jakob99 Posted October 30, 2017 Author Posted October 30, 2017 I've tried using windowClick with no success. Maybe I'm doing something wrong? ItemStack rst = mc.player.inventory.mainInventory.get(8); int potpos = itemStackPos(potst); ItemStack pot = mc.player.inventory.mainInventory.get(potpos); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, 8, 0, ClickType.PICKUP, mc.player); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, potpos, 0, ClickType.SWAP, mc.player); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, 8, 0, ClickType.PICKUP, mc.player); Quote
Jakob99 Posted October 30, 2017 Author Posted October 30, 2017 I ran it through intelliJ and the code definitely ran when I pressed the keybind I specified, but nothing in my inventory changed. Quote
Jakob99 Posted October 30, 2017 Author Posted October 30, 2017 Ok, I figured out what I was doing wrong, i was using the wrong slotID. Thanks for tellong me about PlayerControllerMP::windowClick. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.