[Tutorial] Adding Curios slots

Started by JJ_007 on

Topic category: User side tutorials

Active 8 months ago
Joined Apr 2020
Points:
702

User statistics:

  • Modifications: 0
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 56
[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.

Active 4 months ago
Joined Mar 2018
Points:
774

User statistics:

  • Modifications: 0
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 46
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?

Active 1 month ago
Joined Jan 2021
Points:
875

User statistics:

  • Modifications: 5
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 292
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?

Active 1 year ago
Joined Sep 2023
Points:
192

User statistics:

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

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

Active 4 months ago
Joined Dec 2023
Points:
131

User statistics:

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

I get an Error because it's void

Active 3 months ago
Joined Aug 2024
Points:
85

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 18
Are there predetermined…
Sat, 11/23/2024 - 21:55

Are there predetermined SlotTypePresets or can I make my own in Mcreator? If it’s complicated how would I make my own preset? 

Active 8 months ago
Joined Apr 2020
Points:
702

User statistics:

  • Modifications: 0
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 56
As of the latest update you…
Thu, 12/05/2024 - 04:40

As of the latest update you can just use the plugin - it has the ability to make your own slots too