Posted April 17, 20178 yr I'm trying to update some code from an older forge/mincraft version. It's really a basic do something when the player stands on a black of glass. I'm having trouble with the old entity.worldobj.getBlock(posX, posY, posZ) porting it through to forge 1.11 Here is what I have: if (event.getEntity().world.getBlock( ((int) Math.floor(event.getEntity().posX)), ((int) Math.floor(event.getEntity().posY)) - 2, ((int) Math.floor(event.getEntity().posZ))) != Blocks.GLASS) { return; Cheers Airfix
April 17, 20178 yr Blocks are now stored as IBlockStates. You can get the state at a position using World#getBlockState, and get the block from the state using IBlockState#getBlock. Edited April 17, 20178 yr by Jay Avery
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.