Keybind backpack GUI (Curios API)

Started by iMeeTake on

Topic category: Help with modding (Java Edition)

Last seen on 16:22, 15. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Keybind backpack GUI (Curios API)
Tue, 09/10/2024 - 18:27 (edited)

Hi all! I want to make a mod for a backpack that would work through a slot in the Curios API. There were no problems creating the backpack as an item for Curios. How can I make it so that when I press a key, the graphical interface of the backpack that is currently worn opens and so that things are saved in a specific backpack even after closing the GUI?

Edited by iMeeTake on Tue, 09/10/2024 - 18:27
Last seen on 12:23, 17. Sep 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
On keybind pressed, check…
Wed, 09/11/2024 - 02:45

On keybind pressed, check for item in inventory, if = true, then use the open gui procedure. Idk how to check a certain curio slot but if theres no procedure then you can use the trigger in inventory tick. In the gui settings or the inventory slots themselves there should be an option to save items when closed.

Last seen on 16:22, 15. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I figured out how to make…
Wed, 09/11/2024 - 05:16

I figured out how to make the GUI open only if there is a backpack in a particular slot. At the same time, when I close the GUI, all the objects placed there come back to me. I do not know what to do with it :(

Last seen on 12:23, 17. Sep 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Go to your gui and click on…
Wed, 09/11/2024 - 12:55

Go to your gui and click on the inventory slots, uncheck the box which says drop items when gui not bound to any external inventory is closed. The gui should be bound to the backpack item, idk how to bind it without having it trigger on right click, you could also have it so the gui opens on right click when in hand and also when key pressed in inventory?

Last seen on 16:22, 15. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want the backpack to be…
Wed, 09/11/2024 - 14:59

I want the backpack to be opened with a key when it is in the Curios slot. The ability to right-click to open it is not needed... I don't understand how to make different backpacks have separate interfaces from each other and everything work well :(

Last seen on 16:22, 15. Sep 2024
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
UPD: if you simply attach a…
Wed, 09/11/2024 - 15:11

UPD: if you simply attach a GUI to the backpack and open it using a key with the condition that the backpack is on, objects can be put down, but when you open the backpack again they will not be there

Last seen on 12:23, 17. Sep 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Go to the items advanced…
Wed, 09/11/2024 - 23:12

Go to the items advanced properties and bind the item to your backpack gui. Add the number of slots etc. This will make it so the gui and its inventory is bound to the backpack item and the items will save within it. Although this will automatically make it so that when you right click the inventory will open. Idk if theres some way to override this but you could add a trigger to on right clicked to close any open gui. Although when keybind pressed wont open the specific gui bound to the backpack but to a general temporary gui which is why the items either disappear or drop back into your inventory depending on the inventory slots settings.

Last seen on 12:23, 17. Sep 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There might be a way to…
Wed, 09/11/2024 - 23:13

There might be a way to recognise and store the items through nbt values but you would have to check every slot in the open gui when closing it and re add the items upon opening it again.