Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.10.2][SOLVED][TUT INSIDE] Overriding survival inventory player gui

Featured Replies

Posted

hello i want to make that player inventory does not base on slots number but on weight of items i arelady maded a weight part but now how do i change player inventory?

 

EDIT:

i have found a tutorial how to do this: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-forge-1-6-4-1-8-custom-inventories-in-items-and

hello i want to make that player inventory does not base on slots number but on weight of items i arelady maded a weight part but now how do i change player inventory?

 

Do you mean stacksize number, because slots number doesn't make sense for me. If i understand it right, i think you want to do something similar as terrafirmacraft? Food for example cannot be stacked but has a weight instead.

Maybe there is an event you can call to set the max stacksize of all items to 1. Not sure if this is even posseble. If you make your own items you can use setMaxStackSize(1)

  • Author

hello i want to make that player inventory does not base on slots number but on weight of items i arelady maded a weight part but now how do i change player inventory?

 

Do you mean stacksize number, because slots number doesn't make sense for me. If i understand it right, i think you want to do something similar as terrafirmacraft? Food for example cannot be stacked but has a weight instead.

Maybe there is an event you can call to set the max stacksize of all items to 1. Not sure if this is even posseble. If you make your own items you can use setMaxStackSize(1)

if you know the RPG games like The Witcher 3 then i want to make a inventory work like that you can stack items but depending on how much you have then if you reach limit you cant grab any more items and you are slower and i want to add a scroll bar to inventory and a counter how much you are carrying right now and what is your max

Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.

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.

  • Author

Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.

ok but how to do that (i'm new to guis)

Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.

ok but how to do that (i'm new to guis)

Since it is an inventory create a class that extends GuiContainer and a class that extends Container. Then look at vanilla for examples on what the methods do.

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.

  • Author

Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.

ok but how to do that (i'm new to guis)

Since it is an inventory create a class that extends GuiContainer and a class that extends Container. Then look at vanilla for examples on what the methods do.

is this what do you mean?

https://github.com/lukas2005/IDEA-Mod/commit/a83ad2a0b48764333f3095d67bca07328d5d04d9

Only commenting to ask, since the vanilla "mainInventory" array stored in the InventoryPlayer only holds 36 ItemStacks (not counting the 4 armor slots, and 1 offhand)

 

What if the player had picked up enough items that weighed nothing (feathers) and filled the inventory. Even if the player had enough carry limit left they still wouldn't be able to pick up anymore. I guess the event "PlayerEvent.ItemPickupEvent" could be used to magically move a picked up item to a new "weighted" inventory but that still leaves to question that the hotbar (first 9 slots of the mainInventory) needs to be able to  have items picked up/moved to.

  • Author

Only commenting to ask, since the vanilla "mainInventory" array stored in the InventoryPlayer only holds 36 ItemStacks (not counting the 4 armor slots, and 1 offhand)

 

What if the player had picked up enough items that weighed nothing (feathers) and filled the inventory. Even if the player had enough carry limit left they still wouldn't be able to pick up anymore. I guess the event "PlayerEvent.ItemPickupEvent" could be used to magically move a picked up item to a new "weighted" inventory but that still leaves to question that the hotbar (first 9 slots of the mainInventory) needs to be able to  have items picked up/moved to.

easy just make also weighted hotbar

Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.

ok but how to do that (i'm new to guis)

Since it is an inventory create a class that extends GuiContainer and a class that extends Container. Then look at vanilla for examples on what the methods do.

is this what do you mean?

https://github.com/lukas2005/IDEA-Mod/commit/a83ad2a0b48764333f3095d67bca07328d5d04d9

Yes, but you actually need to put information ie slots, slot interaction, etc. You should look into vanilla classes for 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.

  • Author

Make a custom container and a custom gui then intercept when a container is opened using the ContainerOpenEvent (think that is the name and the one you should use) check if it is the platers inventory then just call player.openGui like normal and open yours.

ok but how to do that (i'm new to guis)

Since it is an inventory create a class that extends GuiContainer and a class that extends Container. Then look at vanilla for examples on what the methods do.

is this what do you mean?

https://github.com/lukas2005/IDEA-Mod/commit/a83ad2a0b48764333f3095d67bca07328d5d04d9

Yes, but you actually need to put information ie slots, slot interaction, etc. You should look into vanilla classes for this.

ok i have found a tutorial how to do this

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.