Jump to content

Edit or override vanilla inventory


Jay Avery

Recommended Posts

I want to edit the standard player inventory (to change the crafting grid size and reduce the amount of item stacks the player can carry). Is it possible to do this using forge? I know it's difficult to alter vanilla things, but is there any way? If it makes things easier, I'm not worried about compatibility with other mods, because mine will only be used by itself.

Link to comment
Share on other sites

Cancel the GuiOpenEvent when the gui is the player inventory, and open your own inventory from there.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

If you send a packet to the server, you can use an

IGuiHandler

to open a custom

Container

as well as a custom

Gui

.

 

P.S. There may be other, better ways, but this is the only way I know of.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

P.S. There may be other, better ways, but this is the only way I know of.

I believe there is a OpenContainerEvent or similar name same function.

 

*Edit You can not use OpenContainerEvent as for why Diesieben explains just below this.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I believe there is a OpenContainerEvent or similar name same function.

Yes there is, but it will not work for the player inventory, or at least not how you expect.

As far as the server is concerned you are always interacting with a Container, if it's not a chest or something you are interacting with the inventory container. The server does not actually have any idea whether you are currently actually looking at the inventory screen or not.

That is actually good to know, thanks for the information.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.