Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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?

  • Author
1 minute ago, poopoodice said:

Where does that mc came from?

Sorry!

Minecraft mc = Minecraft.getMinecraft();

 

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.