Jump to content

Recommended Posts

Posted

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

    }

 

Posted

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?

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

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

Posted
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

Posted (edited)
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
Posted
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.

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.