Jump to content

Swapping ItemStacks in Inventory


Kognise

Recommended Posts

Hey! I'm trying to swap two ItemStacks server-side and client-side within the player's inventory. The current function I have is doing absolutely nothing - any ideas why?

 

private void swap(Integer from, Integer to) {
    Integer windowId = mc.thePlayer.inventoryContainer.windowId;
    mc.playerController.windowClick(windowId, from, 0, ClickType.PICKUP, mc.thePlayer);
    mc.playerController.windowClick(windowId, to, 0, ClickType.SWAP, mc.thePlayer);
    mc.playerController.windowClick(windowId, from, 0, ClickType.PICKUP, mc.thePlayer);
}

 

Thanks in advance!

Edited by Kognise
Link to comment
Share on other sites

25 minutes ago, Kognise said:

Hey! I'm trying to swap two ItemStacks server-side and client-side within the player's inventory. The current function I have is doing absolutely nothing - any ideas why?

 


private void swap(Integer from, Integer to) {
    Integer windowId = mc.thePlayer.inventoryContainer.windowId;
    mc.playerController.windowClick(windowId, from, 0, ClickType.PICKUP, mc.thePlayer);
    mc.playerController.windowClick(windowId, to, 0, ClickType.SWAP, mc.thePlayer);
    mc.playerController.windowClick(windowId, from, 0, ClickType.PICKUP, mc.thePlayer);
}

 

Thanks in advance!

Where does that mc came from?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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