Posted December 12, 201410 yr well this is akwarks but is the same post named [1.8] world.setBlock(x, y, z, block , meta, mode); method has disapear in 1.8 ? i just change the name this morning loking for an answer to solve this the method i used to use to create blocks in the world is dissapear or maiby now has a diferent name ¿how do you create a especific block at especific coordinates at especific world? in the other hand worldIn.destroyBlock(pos, true); is back and works like old times searching for a suitable method to create blocks the more close to world.setBlock() is worldIn.func_180497_b(pos0, blk ,int ,int ); but or is not or idont know hot to se it work i have this theory. they change te name of world.setBlock(xyz block) to something else and i need this method to create custom estructures i do this in mi testBlock class public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { Block blk = Blocks.furnace; BlockPos pos0 = new BlockPos(pos.getX(), (pos.getY()+3) , pos.getZ()); worldIn.func_180497_b(pos0, blk , 0 , 0); worldIn.destroyBlock(pos, true); } on rigth click the block must be destroy and it must create a furnace 3 blocks up but it destroy and drop the test block but no furnace has been created again ¿ what is the method in 1.8 to create blocks in the world ?
December 12, 201410 yr World#setBlockState You don't set blocks anymore, but rather 'state's of blocks that contain the metadata themselves. BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
December 12, 201410 yr To get the right block state, use something like Blocks.stone.getDefaultState()
December 12, 201410 yr Author damn your rigth the just skip the step of defining the block adjunting it to blockState public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { Block blk = Blocks.furnace; BlockPos pos0 = new BlockPos(pos.getX(), (pos.getY()+1) , pos.getZ()); IBlockState state0=blk.getDefaultState(); System.out.println("BlockPos pos="+pos.toString()); System.out.println("BlockPos pos0="+pos0.toString()); worldIn.destroyBlock(pos, true); worldIn.setBlockState(pos0, state0); playerIn.addChatComponentMessage(new ChatComponentTranslation("destruyete Blockesitu", new Object[0])); return false;} and it dont like me this mean i must declare an object of eachtype of block and extract from it the Iblockstate
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.