How to make Rotatable Block [VIDEO TUTORIAL]

86 posts / 0 new
Last post
Offline
Last seen: 14 min 43 sec ago
Joined: 08/27/2013 - 18:03
Gems: 483
How to make Rotatable Block [VIDEO TUTORIAL]

Hi. Because there is not his feature in MCreater itself and many of you need it for your mod , I decided to make a video tutorial how to make custom block rotatable , using PropertyDirection.
LINK

 

 

Edited by: Klemen on 01/04/2017 - 21:31


ArcaneMortis's picture
Offline
Last seen: 12 months 2 days ago
Joined: 08/06/2015 - 01:00
Gems: 143
Gahhh, you're the best! Its a

Gahhh, you're the best! Its a shame this is so tedious, having to do this for almost every single 3D object can be a pain! :/ 

Block rotation has GOT to be in the next mCreator update if anything else!!

ArcaneMortis's picture
Offline
Last seen: 12 months 2 days ago
Joined: 08/06/2015 - 01:00
Gems: 143
Nuparu, Is there a way to

Nuparu, Is there a way to extend PropertyDirection to blocks added on update tick? Lets say I've followed your tutorial, and made a block that faces south and adds a block on update tick. How do I make the new block also face south? Is it a simple event condition variable (i, j, k)? 

Offline
Last seen: 14 min 43 sec ago
Joined: 08/27/2013 - 18:03
Gems: 483
The default block placing is

The default block placing is something like:
world.setBlockState(new BlockPos(i, j+1, k), BLOCK.getDefaultState(), 3);

 

The bold part are the coords in wolrd and the italic part is the BlockState. BlockState have id - metadata so I would try getting the metadata from 1st block and then use the id on placing the 2nd block like:
 

world.setBlockState(new BlockPos(i, j+1, k), BLOCK.getStateFromMeta(BLOCK.FACING,((BLOCK2)world.getBlockState(new BlockPos(i,j,k).getBlock()).getMetaFromState(world.getBlockState(new BlockPos(i,j,k))))), 3);

 

MicroRave's picture
Offline
Last seen: 2 months 3 weeks ago
Joined: 03/24/2016 - 04:17
Gems: 24
I tried working through this

I tried working through this tutorial yesterday (even got it to compile on the first try) and came back this morning to find that the code in my Chair's java file had reverted to what it was before attempting the tutorial. Even the blockstate file went back to what it was and I had manually replaced it and hit the save button.

Offline
Last seen: 2 weeks 5 days ago
Joined: 10/10/2016 - 04:36
Gems: 9
Rotatable Slab

Hello,

I went through this tutorial and got it working. I was  needing if you knew how to get a slab to rotate. I tried this method. But it doesn't seem to work. Any clues?

Offline
Last seen: 14 min 43 sec ago
Joined: 08/27/2013 - 18:03
Gems: 483
By" slab to rotate" you mean

By" slab to rotate" you mean some sort of a "wall slab"?

Offline
Last seen: 2 weeks 5 days ago
Joined: 10/10/2016 - 04:36
Gems: 9
Rotatable Slab

i mean a rotation on the y axis. I am trying to do a slab with a line on top. It needs to able to face north/south and east/west. Although a tutorial on wall slab would be nice too!

Offline
Last seen: 14 min 43 sec ago
Joined: 08/27/2013 - 18:03
Gems: 483
So something like this?

So something like this?

Well then I do not see why it should not work. Can I see your code + also the your current code makes it not rotate , or it rotates in wrong direction?

Offline
Last seen: 2 weeks 5 days ago
Joined: 10/10/2016 - 04:36
Gems: 9
RE:So something like this?

@Nuparu00 Yes this is what I mean. Also, after I change the code, and save it then come back after closing MCreator my code is reverted back to the default. Any, idea why? I will add my code shortly.

 

xXMCXx's picture
Offline
Last seen: 1 week 1 day ago
Joined: 12/27/2013 - 21:01
Gems: 384
RE:So something like this?

Hey, Nuparu. Is there a way I may contact you privately?
-Moderator xXMCXx

Moderator

Pages