How to import own files to project?

Started by RIsingEntrtain on

Topic category: Help with MCreator software

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to import own files to project?
Fri, 09/15/2023 - 08:23 (edited)

Dear all, 

I've recently started creating mods with Mcreator. To gain first experience with modding the tool is great! Now I need ersteinmal about 20 custom items (later then 100+) including recipe and reverse recipe - and the whole thing about the Mcreator to create just takes too long. Also to create the functions of the procedure behind it takes too long via the drag-and-drop editor and hangs constantly at only 10 items.

Since I have a lot to do with programming in my full-time job (although not with Java/jscript etc) it seems to me more performant and easier to work directly in the coding instead of via the interface. To simplify the whole thing a bit, I have reworked the following files and/or created new files based on the ones created with MCreator:

- G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\java\net\mcreator\oresmelter\enchantment
#removed shovel from the blacklist of the Enchantment created with Mcreator (SmeltingEnchantment.java)

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\java\net\mcreator\oresmelter\init
#OresmelterModEnchantments.java nothing changed
#OresmelterModItems.java added each line one for each custom item to "import" and the class registry
#OresmelterModTabs.java added each one line for each custom item to "tabData.accept.."

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\java\net\mcreator\oresmelter\item
#added each one file for each custom item i need

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\java\net\mcreator\oresmelter\procedures
#extended the procedure that I've initially created within MCreator.
Question here: Mcreator creates a new variable "int Index01", "int Index02"... "int Index91" etc. for each loop (not nested).
Is this a "feature" in java or Mcreate that I need a new variable each time? In my extension of the file I use for each loop "int indexA" for Minecraft items and "int indexB" for custom items, just for better overview. Does this work or do i have to rework this to have each time a new variable?
 

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\resources\assets\oresmelter\lang
#added all items to de_de.json and en_us.json

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\resources\assets\oresmelter\models\item
#added each one Item.json file

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\resources\assets\oresmelter\textures\item
#added each one item_tex.png file

-G:\Spiele\MinecraftCreator\Workspace SmelterMod - Kopie\src\main\resources\data\oresmelter\recipes
#added each one CustomItem_recipe.json and CustomItem_recipe_reverse.json

 

So from my point of view I've changed all relevant existing files and created the items/recipes i would need. However when ich do load the project from an fresh opened Mcreator or by starting the oresmelter.mcreator file it does delete the changes to procedure and language translations and only shows the items that where originally created within the Mcreator. The files ive added are not touched but also not loaded into the project.

Is there any other file hidden somewhere that need to be changed or is there any way i do not see to import this files? "import from zip file" does not work and all the other import options are plenty texture import options...

 

best regards

RisingEntertain


*Edit below a quick and dirty code C# I've used to create the files, just in case someone would like to check the files I've used. Just paste into a .net 6.0 console project and type the following to create the files

smaragd 
emerald

or

glatter_stein
smooth_stone

 

https://pastebin.com/FKLyfdaZ
Edited by RIsingEntrtain on Fri, 09/15/2023 - 08:23
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I see that option, but only…
Fri, 09/15/2023 - 09:54

I see that option, but only on existing elements. But how do I import new Items/recipes? How do I tell Mcreator "I have created new files outside of your tool, please go ahead and load this files"?

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
They are automatically…
Fri, 09/15/2023 - 11:20

They are automatically loaded.

 

Any .java file in the Source Folder will be automatically loaded.

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmm, not sure whether I'm…
Fri, 09/15/2023 - 12:14

Hmm, not sure whether I'm kind of stupid at the moment or whether there needs to be changed something.

Please find below a copy of my modified workspace. If you check the files before attempting to open the workspace, all items and recipes are available and the corresponding files are maintained. As soon as i start the workspace, most of this is gone. Beside the workspace ive attached all the files ive created and the c# code I'm using to create the files.

Are you able to see the following 19 items with each 9 variants with recipe and reverse-recipe in Mcreator and are able to build the mod file? 
cobblestone, diamond, iron_ingot, end_stone, dirt, smooth_stone, gold_ingot, gravel, coal, copper_iingot, lapis_lazuli, netherrack, redstone, raw_iron, raw_gold, raw_copper, sand, emerald, stone

https://www.file-upload.net/download-15188154/modifiedWorkspace.zip.html
 

You need to make Java files…
Sat, 09/16/2023 - 08:10

You need to make Java files outside main mod package, eg. if you have mod package net.mcreator.modid, you can eg. put custom files in net.mcreator.custom or org.example, for example