How to make Rotatable Block [VIDEO TUTORIAL]

Started by Nuparu00 on Sun, 09/25/2016 - 16:43
Last seen on 22:00, 11. Dec 2017
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
How to make Rotatable Block [VIDEO TUTORIAL]
Wed, 01/04/2017 - 20:31 (edited)

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 Wed, 01/04/2017 - 20:31
Last seen on 13:46, 24. Oct 2016
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Gahhh, you're the best! Its a
Tue, 10/04/2016 - 16:48

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!!

Last seen on 13:46, 24. Oct 2016
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Nuparu, Is there a way to
Tue, 10/04/2016 - 18:45

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)? 

Last seen on 22:00, 11. Dec 2017
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
The default block placing is
Tue, 10/04/2016 - 21:28

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);

 

Last seen on 19:39, 7. Dec 2017
Joined Mar 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I tried working through this
Tue, 10/11/2016 - 20:14

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.

Last seen on 21:49, 1. Oct 2017
Joined Oct 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Rotatable Slab
Mon, 11/07/2016 - 19:56

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?

Last seen on 22:00, 11. Dec 2017
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
By" slab to rotate" you mean
Wed, 11/09/2016 - 06:14

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

Last seen on 21:49, 1. Oct 2017
Joined Oct 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Rotatable Slab
Wed, 11/09/2016 - 15:22

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!

Last seen on 22:00, 11. Dec 2017
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
So something like this?
Fri, 11/11/2016 - 14:50

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?

Last seen on 21:25, 8. Dec 2017
Joined Dec 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
RE:So something like this?
Fri, 11/11/2016 - 17:39

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

Last seen on 06:03, 17. Jun 2017
Joined Sep 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
if(true){world.setBlockState
Sat, 11/12/2016 - 06:38

if(true){
world.setBlockState(new BlockPos(i - 1, j, k),
 mcreator_titaniumOre1.block.getStateFromMeta(mcreator_titaniumOre1.FACING,
((1)world.getBlockState(new
BlockPos(i - 1, j, k).getBlock()).getMetaFromState(world.getBlockState(new
BlockPos(i - 1, j, k))))), 3);
}

did i made something wrong?