[Curios API] Retrieve the contents of a specific slot

Started by KayPengin on

Topic category: Help with modding (Java Edition)

Last seen on 22:35, 29. Aug 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Curios API] Retrieve the contents of a specific slot

Sorry in advance if my English is bad, I'm not very good with this language.

I'm coding a mod where we can put spell scrolls in the inventory offered by Curios API. I created a 'bunble' with 3 slots to be able to use three different spells. So I would like to know how to retrieve the 'itemstack' of the items in the Curios inventory.

I ask this because I noticed that with the '/dev' command we can see the contents of the Curios API inventory.

[...]ForgeCaps: ("curios:inventory": <Curios: [<StacksHandler: (SavedBaseSize: 3, RenderToggle: 1b, Renders: (Size: 3, Renders: [<Render: 1b, Slot: 0), (Render: 1b, Slot: 1), (Render: 1b, Slot: 2)]), Visible: 1b, Stacks: (Size: 3, Items: [(Slot: 0, id: "univeria:fire_ball_scroll", Count: 1b)), [...]


Additionally, I tried using ChatGPT, unfortunately it tells me to use 'import top.theillusivec4.curios.api.type.inventory.ICurioItemHandler;' Which constantly gives me an error.