Topic category: User side tutorials
Welcome to my first Tutorial for MCreator - 2022.1!
In this Tutorial i show u how to change the Block Model/Texture via Blockstates ingame!
First we need the MCreator Plugin for Blockstates - Click here
Drag the Plugin inside your Plugins Folder in your MCreator Installation.
Now we start MCreator and select 1.18.2 Forge as Generator.
Create a simple Block or use your own already created Blocks.
Dont forget to set your Procedures now or u need to change them via Code later again.
Here begins the Text Tutorial - Here is also a bad english Video Tutorial - Click Here
One Important thing is to set a Block Rotation Mode:
Without a Block Rotation Mode its not possible to start.
So now after set a mode and set all Triggers to the right Procedures we start with the Code.
Lock your Block Element and open the yourblocknameBlock.java
It should look like this:
Now add after:
This:
Now search for:
Now final thing is to add it to the builder of the blockstatedefinition.
Search for:
Now check for the import at the begin of the Code:
If its missing add it on your own!
Now after finishing all hit save and close the Code.
Now on the left side in the Workspace File Browser:
In Resources (Gradle)/assets/yourmodname/blockstates/yourblock.json open it!
it should look like this for example:
change it to:
hit save and close it.
now in the Workspace File Browser go to:
Resources (Gradle)/assets/yourmodname/models/block/
Rightclick on the folder block and create a new json.
name it yourblock_mynewcustomstate
and a second one yourblock2_mynewcustomstate
now open both and open the default json of your main block so yourblock.json and copy the content of it in both other json files.
now the json files should look like this:
in yourblock_mynewcustomstate.json u can hit save after copy from the default yourblock.json
in yourblock2_mynewcustomstate.json u need to change the texturename to the new texture:
after set the right texturename hit save.
now we need one of the procedures u made before like if block is rightclicked or something.
so go in the procedure that should change the block texture for u.
my example is this in the trigger "On block right clicked":
After finishing the Procedure save it and start the client via run client.
now pick your block and place it and rightclick it and it will change its texture or model.
if u use very different models with many sides and texture parts please copy the content of the json of it per state dont use the same json as placeholder like if u made mynewblockmodel1 and mynewblockmodel2 with 2 complete different models u need to copy the content of your dif models in Resources (Gradle)/assets/yourmodname/models/block/mynewmodel1.json or Resources (Gradle)/assets/yourmodname/models/block/mynewmodel2.json
THANK YOU SO MUCH !!! IT'S PERFECT
It doesn't work for me
followed all the steps but the game refuses to boot up
NVM I was just dumb, it works for me.
Thanks very much.
Since one of the new mcreator updates blockstates can be set in the editor and all became much easier. Now only blockstates/.json should be modfied in code editor to change model (and testure json if you use them)