How do I make a curios item using the API?

Started by DerexXD on

Topic category: Help with Minecraft modding (Java Edition)

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. 

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. 

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

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 

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 

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 

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?

Joined Jun 2019
Points:

User statistics:

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

how

 

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

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 ?

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  

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???

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!