Move objects from workspace to workspace in MCreator

Started by EleckFan5935 on

Topic category: Help with MCreator software

Last seen on 17:39, 25. Feb 2023
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Move objects from workspace to workspace in MCreator
Sun, 02/05/2023 - 01:27 (edited)

Warning! This manipulation is at your own risk of losing your workspace or even your mod! Make a backup before manipulating workspace.

Hi, I just opened this topic for this manipulation as many asked if there is a way. There is one but it is risky.

First, you might get to folder directory of both workspaces (getting in the workspace, open directory then open Source (gradle) using default program), then open *.mcreator files from both. When you reached the directory, close MCreator if opened. Put the text editor away.

Now, transfer the object you want (e.g. WoodenPlanks) in the other workspace. Meaning you'll have to go in the directory /src/main/java/net/mcreator/(mod name)/blocks if object is block, or /item/ if object is item. There should be *.json file with name of item. Transfer that *.json to the other directory and open it in a text editor. Change line 2 to:

package net.mcreator.(your_workspace_modID).block; /* If it's a block */
package net.mcreator.(your_workspace_modID).item; /* If it's an item */

if you don't wanna have error. Go then to /init/, open up both from workspaces (YourWorkspaceName)ModBlocks.java if it's block or (YourWorkspaceName)ModItems.java if it's item, then transfer the import. For example, I wanna transfer an item named Lusht Dust. I must then do the following to import it on other workspace:

import net.mcreator.dimensions.item.LushtDustItem; /* dimensions is the mod package name, LushtDust is the item name, Item is the object type */
/* 
Thing happening there, not to touch
*/
	public static final RegistryObject<Item> LUSHT_DUST = REGISTRY.register("lusht_dust", () -> new LushtDustItem()); /* Making the item a real Minecraft Item by registering him in the Items list */

Now, save the files and close them (don't close the *.mcreator file!).  Now we are gonna register our item to be modifiable in the workspace. First, get the item definition in the first workspace, e.g :

    {
      "name": "LushtDust", /* Name of the element */
      "type": "item" /* Type of the element */
      "sortid": 1, /* The sort ID of the element, if it is the first element of the workspace, it should be then 1 */
      "compiles": true,
      "locked_code": false, /* Locks the base code being it unmodifiable by MCreator */
      "registry_name": "lusht_dust" /* Registry name, like in ModItems.java */
    }

Get to the end of the current bracket "mod_elements" in the second workspace. The end is above "variable_elements" bracket, should be easy to find :D (i'm joking, all depending on the workspace). Put then the element definition in there. If any element is before that one, add a comma just before the last bracket before the transferred element definition.

Now get to /src/main/resources/assets/(YourModPackageName)/ in both workspaces and get the textures in /textures/(block/item/models) of the first workspace then transfer to the second one. Next, get the /blockstates/ if it is a block, and replace every first workspace package name you find by your second workspace package name. E.g. replacing "mymodpackage" by "dimensions". Next, get the /models/block/ or /models/item/ and replace again every first workspace package name you find by your second workspace package name. If your block object is breakable by axe or any tool, it must be precised in /src/main/resources/data/minecraft/tags/blocks/mineable/(toolname).json by adding the block in the bracket like this: "(YourModPackageName):(YourBlockRegistryName)", e.g. "dimensions.lusht_dust_block".

When all steps are done, save every file open, then close them, but don't close *.mcreator files, then open both workspaces. Run gradle task "build" and it should return without any error. If it still returns an error, save the current state of the *.mcreator file as the task overwrites it if an error occurs, then try to fix it by checking all steps again making sure you did them correctly then check this step again. If it returns no error, congratulations! Your object is transferred!

 

Let me know if any errors are there, I'm not such a master coder.

Also, the best thing you could do, is support MCreator in hope they'll make actually a function about it.

Edited by EleckFan5935 on Sun, 02/05/2023 - 01:27