Posted November 16, 20168 yr 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
November 16, 20168 yr 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) Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
November 16, 20168 yr 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
November 16, 20168 yr 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.
November 16, 20168 yr 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)
November 16, 20168 yr 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.
November 16, 20168 yr 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
November 16, 20168 yr 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. Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
November 16, 20168 yr 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
November 16, 20168 yr 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.
November 17, 20168 yr 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.