Topic category: Feature requests and ideas for MCreator
I think there should be an option so that your blocks can face a certain direction (Like how logs, quartz pillars etc. rotate depending on what's next to them)
Also, Bring back slabs and stairs! I want to add slabs and stairs of my block but it would involve a LOT of model and code.
I am also not able to use techne models, either tell me how to do this or add it as a feature because I prefer techne to blender and it's annoying how I can't use it. Plus, BDCraft only uses one texture, so I can't do as much with that.
Another problem I've had is that I can't get any of my blocks to act like grass, and when I try and create a new biome with one of these grass-based blocks no trees or plants spawn on it and I don't know why. It's so annoying as I'm trying to create an extended nature mod which has thing like wet grass, muddy grass, dry grass etc. and they don't work, even when I set the material to grass (Maybe add an option for grass-like spreading?)
I have your problem too: i maked secret glass (with that you can see other player but other players can't see you) but i can't rotate it.
Try use PropertyDirection.
You need variable for it:
public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
and in constructor define default state:
this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
Now you need these methods:
[spoiler]
@Override
public IBlockState getStateForEntityRender(IBlockState state) {
return getDefaultState().withProperty(FACING, EnumFacing.SOUTH);
}
@Override
public IBlockState getStateFromMeta(int meta) {
EnumFacing facing = EnumFacing.getFront(meta);
if(facing.getAxis()==EnumFacing.Axis.Y) {
facing=EnumFacing.NORTH;
}
return getDefaultState().withProperty(FACING, facing);
}
@Override
public int getMetaFromState(IBlockState state) {
return ((EnumFacing) state.getValue(FACING)).getIndex();
}
@Override
protected BlockState createBlockState() {
return new BlockState(this, new IProperty[]{FACING});
}
[/spoiler]
This one theoretically you don't need. Make rotate the model to opposite side of player look:
[spoiler]
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos,
EnumFacing facing, float hitX, float hitY, float hitZ, int meta,
EntityLivingBase placer) {
return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
}
[/spoiler]
And in the blockstate .json file asign the variable:
This is from my model file (your values can be maybe diffrent):
{
"variants": {
"facing=up": { "model": "MyMod:Armchair" },
"facing=south": { "model": "MyMod:Armchair" },
"facing=east": { "model": "MyMod:Armchair", "y": 270 },
"facing=west": { "model": "MyMod:Armchair", "y": 90 },
"facing=north": { "model": "MyMod:Armchair", "y": 180 }
}
}
To make slabs and stairs you need to (unless you already know how to) use Mr. Crayfish's Model Creator. Then make a slab, stairs or something.
After making it, export to a. JSON file. When that's done, make a block and put the JSON file in (To render the slab like a slab, in aesthetics, go to maximum Y and put 0.5)
After that the block is made. Hope it sort of helped
Hey - I know this is almost two years later - but uhm - where exactly do you PUT this code? I mean - is there a specific place in the code that you insert this?
Sorry - I meant to address Nuparu00 specifically - but if anyone else knows that would be helpful - would be good to know where to PUT these variables.