Posted June 17, 20178 yr Previously I tried to use .nbt files with structure_spawners but I think I gotta start with the basics by using .java files, I want to use coarse dirt as a part of my structure but it doesn't appear on blocks.class, maybe I have to set the data Idk that's why I need help, here is the method I use to add each block on place: worldIn.setBlockState(new BlockPos(x+1,y+0,z+3), Blocks.DIRT.getStateFromMeta(0));
June 17, 20178 yr You're using the state that's equivalent to metadata 0, which is the default state (standard dirt). Coarse Dirt is a different variant of Blocks.DIRT. Don't use metadata values. Use Block#getDefaultState to get the default state, then use IBlockState#withProperty to get the IBlockState with BlockDirt.VARIANT set to BlockDirt.DirtType.COARSE_DIRT. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 24, 20178 yr Author worldIn.setBlockState(new BlockPos(x+1,y+0,z+3), Blocks.DIRT.getDefaultState().withProperty(BlockDirt.DirtType.COARSE_DIRT, value)); what do I put in value? when I remove it gives me an error.
June 24, 20178 yr It's supposed to be Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT) according to the method signature.
June 24, 20178 yr Author Just now, ctbe said: It's supposed to be Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT) according to the method signature. I did it the same thing right after you commented but thanks for letting know the other players.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.