Use a villager profession block from another mod

Started by Makeight on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use a villager profession block from another mod

Minecraft 1.19.2

MCreate 2023.2

How can I make a resident change their profession on the workbench from MrCrayfish's Gun Mod?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could presumably just…
Thu, 10/12/2023 - 21:38

You could presumably just lock the procedure, and replace the block reference with the mod id and registry name from the modded block you want. (Probably make sure to include a check in your procedure that the mod is loaded, otherwise this could cause issues if the procedure attempts to run without the mod installed.)

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I do it? I don't…
Fri, 10/13/2023 - 10:09

How can I do it? I don't understand when can I get this procedure 

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
CodeI understand how to do…
Fri, 10/13/2023 - 10:45

Code

I understand how to do it in json, but not in java

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You would make the villager…
Sat, 10/14/2023 - 13:21

You would make the villager code like normal, and use some sort of placeholder for the profession block. Then you would lock all the code for that mod element, find the places where it references the placeholder, and replace it with the registry name of the modded block you want it to use. (Keeping in mind this will likely break if the other mod isn’t installed.)

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you give me an example…
Mon, 10/16/2023 - 05:55

Can you give me an example of how I can do this? 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here's an example of what…
Mon, 10/16/2023 - 11:54

Here's an example of what the locked mod element looks like; you would need to replace the highlighted block with the registry name from the mod. That being said, this actually looks more difficult than I initially thought. Villager professions are one of the main init files, which means they're always regenerated regardless of whether or not you lock them; you would have to do this last, and the suspend the regeneration of everything else to make sure it doesn't revert to the placeholder block. What's more, it looks like you'll likely need to import something or other, and I'm not entirely clear on the syntax. It's not just the simple copy-and-paste sort of job I thought, but it may still be possible. When all else fails, just throw stuff at the wall and see if it compiles.

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can reference to another…
Mon, 10/16/2023 - 12:03

I can reference to another mod in the import, right? In this case, the one I need should appear in Blocks

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think so? Again, I'm not…
Mon, 10/16/2023 - 12:05

I think so? Again, I'm not entirely sure how you'd reference this. It's importing blocks already, but possibly not the ones provided by the mod you wanted to reference. May be worth looking into some examples in Github to get an idea of how to do this.