Jump to content

Recommended Posts

Posted (edited)

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
Posted
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?

Posted
58 minutes ago, Kognise said:

Sorry!


Minecraft mc = Minecraft.getMinecraft();

 

I'm not really sure about this, but the problem might be that

Minecraft mc = Minecraft.getMinecraft();

it's only for client side use

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.