Jump to content

Get All Items From A Inventory/GUI


8iggy

Recommended Posts

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

    }

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by 8iggy
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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