Posted September 19, 20214 yr Hello Everyone! I just started learning how to code forge mods and this is my first post. I have been coding spigot plugins for 2 years so I'm not totally clueless. I just want to know how to get all the items from a Inventory/GUI. I have no clue how. I tried something like this. but it got me nowhere @SubscribeEvent public void onOpenInventory(GuiOpenEvent e) { e.getGui().itemsplsssss }
September 19, 20214 yr you can't actually do that, because getGui returns a Screen, which is client side and the client doesn't know the inventory unless the client is looking at the inventory you will need the menu (container) which is server side what do you tried to achieve?
September 19, 20214 yr Author 8 hours ago, Luis_ST said: you can't actually do that, because getGui returns a Screen, which is client side and the client doesn't know the inventory unless the client is looking at the inventory you will need the menu (container) which is server side what do you tried to achieve? So how do I get the container? It doesn't need to be a event btw.
September 19, 20214 yr 8 hours ago, Luis_ST said: what do you tried to achieve? and it depends on the context Edited September 19, 20214 yr by Luis_ST
September 19, 20214 yr Author 2 hours ago, Luis_ST said: and it depends on the context I'm trying to get the item meta of all the items if that helps. like the lore and stuff.
September 20, 20214 yr 7 hours ago, 8iggy said: I'm trying to get the item meta of all the items if that helps. like the lore and stuff. show your code where do you need the items, because the info you gave doesn't help
September 20, 20214 yr Author 19 hours ago, Luis_ST said: show your code where do you need the items, because the info you gave doesn't help I currently have no code. Could you just tell me how to get a server sided container/menu and make it into a variable? Edited September 20, 20214 yr by 8iggy
September 22, 20214 yr Author 18 hours ago, diesieben07 said: Look at the Container class. Look at the list of Slots. Thanks I Figured It Out! I Have Another Thread On How To Get The Container. Maybe You Could Help More There?
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.