Fully Connectable Models (Custom Code)

Started by Shadowmaster435 on

Topic category: User side tutorials

Last seen on 21:57, 28. Dec 2022
Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fully Connectable Models (Custom Code)

THIS IS A CUSTOM CODE TUTORIAL

PART 1

First things first you are gonna wanna make custom code element called "Extendspreinit" spelt exactly like I typed if mcreator adds "MCreator" before the "Extendspreinit" later you will have to refer to the element as its named in the code editor. Now that you have done that paste this in the code editor https://pastebin.com/NFgKgP7b there are a few things you must know about the code Any instance of "MCreatorDynamicmodel" you can replace with the mod element name but it has to match up the upper and lower case letters and any instance of "mcreatordynamicmodel" replace with the mod element name but all lower case, now in the file you will see "elementnumber"CHANGE THIS TO THE LATEST ELEMENT NUMBER OR HIGHER");" do what it says i recommend that you change it to the current mod element number but you don't have to just don't type an existing mod element number one more thing at the very top you will see "package net.mcreator.modid;" change the "modid" part to your modid.

PART 2

now you are gonna need to create 2 blocks with custom models 1 of them has a centered cube the other has a cube facing north and long enough to be touching the block edges DO THIS THROUGH THE INTERFACE for the custom models use blockbench don't forget to assign textures, now create another block for the custom code don't forget to lock the mod element and paste this in the code https://pastebin.com/FX5zXPQ8 , again any instance of "MCreatorDynamicmodel" or "mcreatordynamicmodel" do what you did in part 1 i will address how to change the hitbox and collision later

PART 3

Now go out of the code editor and hit the edit code on the block with the custom code but instead of going into the code go into the blockstate and paste this https://pastebin.com/eqNubNQc now this is where the 2 blocks you made earlier come in to play replace "cablecenter" with the name of the block with the centered cube model DON'T ADD "MCreator" AND MAKE IT ALL LOWERCASE now replace all instances of "cablelimb" with the name of the block with the model that has a cube facing north DON'T ADD "MCreator" AND MAKE IT ALL LOWERCASE make sure to save all of this and thats it you got yourself a fully connectable model please note the model in the inventory will be a purple and black box once i figure out how to change it i will update this post

IMPORTANT NOTE

If you want to change the collision box and hitbox contact me on my discord 

shadowmaster435#1617      if enough people want it i can update or make a new post showing how to change the collision as this post is getting long 

Last seen on 21:57, 28. Dec 2022
Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if you find anything goes…
Mon, 11/18/2019 - 20:36

if you find anything goes wrong like build errors let me know on discord