Posted July 28, 20178 yr Hi guys, I need to write a method that can drop an item from a slot (like the first slot) in the player main inventory without open it. I need it to "delete" this item from my inventory but without a replaceLike method (pick up the inventory slot and set it as Air) because I need to run this mod only on a client that need to access to a vanilla server. So, in short, what I need to do is a process like this: open the inventory (press E); go with mouse on the selected slot; left click with mouse (pick up the item); move the mouse out of my inventory; left click with mouse (drop the item out of my inventory); close the inventory. PS if is possible, I would like to do it without real open and close inventory, to do it in a more efficient way. Anyone have an idea on how can I do it? Thanks. Edited July 31, 20178 yr by oznecniV97
July 28, 20178 yr What does this have to do with Gradle? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
July 28, 20178 yr Author 2 minutes ago, diesieben07 said: You need to check out which packets are sent by the vanilla inventory system and then replicate those. Sorry but, how can I do it? There's a simple method to do that or I need to check manually in the Minecraft classes?
July 28, 20178 yr Author There's a possibility to put minecraft in debug mode like an eclipse project and go ahead instruction by instruction to follow the process and verify it?
July 31, 20178 yr Author This code works fine for the first slot in player inventory: Minecraft mc = Minecraft.getMinecraft(); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, 9, 0, ClickType.PICKUP, mc.player); mc.playerController.windowClick(mc.player.inventoryContainer.windowId, -999, 0, ClickType.PICKUP, mc.player); The first instruction is the left mouse click (3° param is mouse click, 0 for left, 1 for right) on the first slot in player inventory (2° param is inventory slot (0-4 for crafting, 5-8 for armor, 9-35 for inventory)). The second instruction is the left mouse click out of inventory GUI (to drop it down). This code works fine with the inventory closed.
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.