Posted September 9, 20223 yr I would like to add an extra slot of armor Maybe someone can suggest the classes that I need. And where is it to be initialized. And how to put it all together. I understand that I can be asking a lot, but I would just need a direction where to dig. Edited September 9, 20223 yr by Luckydel
September 10, 20223 yr Basically you need a Capability which is attached to the Player, you can use a ItemStackHandler to store the ItemStack. Then you need to add a SlotItemHandler (your Slot) to the Player inventory (Player#inventoryMenu) therefore you need to use Reflection (an AT is here not possible). Unfortunately i have not yet found a Event which would fired at the correct point to add the Slot. Note that you need to add the Slot on server and on client. If you set up everything correctly the Slot should be now displayed in the Player Inventory, you should be able to put in Items. Last but not least you need to render the Slot background in the Inventory, you need to use one of the Screen Events (test which one would be the way to go). Notes: The Slot index of you extra Slot should be calculated based on the Slot count of the inventory, to make sure you don't get any conflicts if other Mods add also Slots to the Player Inventory. I'm not sure if you be able to quick move ItemStacks in your custom Slot, since this is hardcoded in InventoryMenu#quickMoveStack
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.