[TUTORIAL] 2022.1 - 1.18.2 Change Block Model/Texture ingame!

Started by Tarantel on

Topic category: User side tutorials

Last seen on 21:39, 6. Apr 2024
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[TUTORIAL] 2022.1 - 1.18.2 Change Block Model/Texture ingame!

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:
https://i.imgur.com/0haR2Nq.png

 

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:
 

https://i.imgur.com/pToQI0H.png
Now add after:

https://i.imgur.com/sMxDonG.png

This:

https://i.imgur.com/KZYw7mg.png

Now search for:

https://i.imgur.com/nR4typT.png

Now final thing is to add it to the builder of the blockstatedefinition.
Search for:

https://i.imgur.com/FwHjPfO.png

Now check for the import at the begin of the Code:

https://i.imgur.com/IWNmBcm.png

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:

https://i.imgur.com/IBYuyIC.png

change it to:

https://i.imgur.com/Uewnf03.png

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:

https://i.imgur.com/nTbFsRK.png

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:

https://i.imgur.com/pk3E2aB.png

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":
https://i.imgur.com/JeEtqRk.png
 

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
 

Last seen on 06:15, 18. Apr 2024
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
THANK YOU SO MUCH !!! IT'S…
Sun, 06/05/2022 - 08:09

THANK YOU SO MUCH !!! IT'S PERFECT

 

Last seen on 20:41, 23. Jul 2023
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It doesn't work for…
Sun, 11/06/2022 - 11:41

It doesn't work for me
followed all the steps but the game refuses to boot up

Last seen on 20:41, 23. Jul 2023
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
NVM I was just dumb, it…
Wed, 03/22/2023 - 21:40

NVM I was just dumb, it works for me.