[Tutorial] Adding Curios slots

Started by JJ_007 on

Topic category: User side tutorials

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Tutorial] Adding Curios slots

1. Download CuriosAPI plugin

2. Go to workspace settings, external apis, and tick the box next to CuriosAPI

3. Create a new custom code element

4. Copy this into the element, replacing what was already there;

package net.mcreator.YOURMODID;

import top.theillusivec4.curios.api.SlotTypePreset;
import top.theillusivec4.curios.api.SlotTypeMessage;
import top.theillusivec4.curios.api.CuriosApi;

import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.eventbus.api.SubscribeEvent;

@Mod.EventBusSubscriber(modid="your_mod_id", bus=Mod.EventBusSubscriber.Bus.MOD)
public class ModElementName {
    @SubscribeEvent
    public static void enqueue(final InterModEnqueueEvent evt) {
        InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE,
            () -> SlotTypePreset.NECKLACE.getMessageBuilder().build());
    }
}

5. Replace Necklace with whatever you want the slot to be

 

Now to add the item to the slot

1. Open workspace folder

2. Create a folder in src/main/resources/data called "curios"

3. In this folder, create another called "tags"

4. In that one, make one called "items"

5. Then, create a json filed named SLOT.json (e.g. necklace.json) and save it in the folder

6. Paste the following inside, replacing to match your mod;

{
    "replace": false,
    "values": [
        "your_mod_id:item_name"
    ]
}

 

Done! If this helps you let me know, and thanks to MissLexyShaodws and FrostyGames0 for helping me figure it out.

Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have learned how to add an…
Thu, 08/04/2022 - 10:14

I have learned how to add an item and a slot for the Curious API,
but I do not know how to add models or properties for this item.
Can you tell me how to do this?

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey, i got an error saying …
Thu, 11/03/2022 - 19:50

hey, i got an error saying "reached end of file while parsing." any help?

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a plugin that…
Mon, 10/16/2023 - 07:17

Is there a plugin that supports this for 2023.3? :)

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I get an Error because it's…
Sat, 08/17/2024 - 20:29

I get an Error because it's void