Jump to content

Swapping/moving ItemStacks in inventory


Jakob99

Recommended Posts

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

Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.