How do I make a curios item using the API?

Started by DerexXD on

Topic category: Help with modding (Java Edition)

Last seen on 19:30, 8. Feb 2023
Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a curios item using the API?

I need someone to help me make a simple artifact using the curios API. Someone here made a plugin for it but I'm not sure where to go after installing it.

 

For reference, curios is the widely used API that allows you to put rings and stuff on you in inventory slots. You find it in many modpacks. 

Last seen on 20:06, 24. Mar 2024
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not a single soul knows it…
Thu, 05/27/2021 - 22:52

Not a single soul knows it. Or if they know they just doesn't want to help. Asked around the community many times, they doesn't even seems like that they care about the question. 
The stuff is that you have to make your own slots but idk how the hell should we do that if its read only to me when I've installed the API also there is just no proper help about this. 

Last seen on 23:21, 17. Jun 2022
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
After adding it as an API,…
Fri, 05/28/2021 - 00:32

After adding it as an API, you need to register the curio slot types in the InterModEnqueue event. Then after registering the slot type, you need to add your item to the tag called as your slot type. The tag must be in the curios namespace.

And after that, your item can be worn, but if you need additional functionality, you will need to either add ICurio as a capability, or just implement ICurioItem on your item.
All of this, of course, is custom-coded. I can help you with implementing this, or you can try to do it yourself.

Curio documentation

Last seen on 19:30, 8. Feb 2023
Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I understand what you're…
Fri, 05/28/2021 - 16:01

I understand what you're saying but I'm kinda a novice so where would you find the event in code 

 

I can do the rest from there as I get what you're saying 

Last seen on 19:30, 8. Feb 2023
Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah I would really like…
Fri, 05/28/2021 - 16:06

Yeah I would really like help just registering the item 

Last seen on 19:30, 8. Feb 2023
Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
holy (beep) I figured it out…
Wed, 06/02/2021 - 02:23

holy (beep) I figured it out on my own 

Last seen on 16:05, 5. Aug 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What did you do? How did you…
Fri, 06/04/2021 - 18:06

What did you do? How did you figure it out? Can you walk me through it?

Last seen on 14:33, 18. Aug 2023
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how  
Tue, 08/03/2021 - 11:48

how

 

Last seen on 14:19, 13. Feb 2022
Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait bro how   Tell me
Tue, 08/10/2021 - 00:20

Wait bro how

 

Tell me

Last seen on 14:19, 13. Feb 2022
Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Man please a lot of us need…
Sat, 08/14/2021 - 20:20

Man please a lot of us need help on how to make a curios item, could you explain us how you did it ?

Last seen on 19:30, 8. Feb 2023
Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It was all on the curios…
Sat, 08/28/2021 - 15:57

It was all on the curios wiki you just add it to the intermodqueue event and stuff and registering types is really easy too  

Last seen on 11:25, 24. Aug 2022
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But where do you find that…
Mon, 08/30/2021 - 21:38

But where do you find that event???

Last seen on 21:37, 10. Sep 2021
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found out how to do this,…
Fri, 09/03/2021 - 03:05

I found out how to do this, so I'll contribute to this thread!

Note: This is the way do it, it may be wrong or weird but it works for me, so I hope it works for you.

First you need to register a Curios slot (This is assuming you've already added Curios as a dependency through the workspace settings, whether manually or with a plugin). This is the slot in the Curios inventory where you'll put your custom curios. To register a Curios slot you need to create a new custom code element.

Then, once the element is made, there are a few things you need to import, these are for the Curios API and IMC messages. Put these at the top of the element:

import top.theillusivec4.curios.api.CuriosApi;
import net.minecraftforge.fml.InterModComms;
import top.theillusivec4.curios.api.SlotTypeMessage;
import top.theillusivec4.curios.api.SlotTypePreset;

If you're using a custom slot (explained below), you'll need an extra line:

import top.theillusivec4.curios.api.SlotTypeMessage.Builder;

After you've got those done, you need to put this listener (Correct me if it's not a listener, I'm new to Java) between the first @SubscribeEvent line and the main element class (public ElementName() {}) 

private void enqueue(final InterModEnqueueEvent evt) {
  	}

Then, inside this listener (Again, correct me if it's not a listener), you can put the IMC (InterModComms) message. You can choose a preset (Frequently Used Slots) or make your own slot, which requires a little more work.

Curios Preset IMC message (For Head slot):

InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE,
	    	() -> SlotTypePreset.HEAD.getMessageBuilder().build());

If you want to change the preset, change HEAD (between SlotTypePreset and getMessgeBuilder() ) to what preset you want to use in Frequently Used Slots, make sure it's all in uppercase.

Curios Custom slot IMC message:

InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE,
	    	() -> new SlotTypeMessage.Builder("shield").build());

The identifier of the slot is determined by what you put in the string after SlotTypeMessage. This is the identifier you'll use, but to set a visible name, you'll have to go to the "Localization" tab in your MCreator workspace, and create a new entry with the key being "curios.identifier.identifierName", with identifierName being the string you put in the IMC message.

 

Once you've done this (you can put multiple if you want more slots) you can mark an item as an accessory, which you can find the tutorial for here. (The data folder is in MCreatorWorkspaces\yourMod\src\main\resources\data)

I really hoped this helped someone, and if this worked for you, let me know!