-
[SOLVED] Making A Hammer to break a 3X3 Block. Breaking two layers at a time now.
Yeah nevermind, I did that in my old method, got both confused, I decided to experiment with more on my old method instead and it felt much better. Not short but still remembered to do the facings. Well now it is solved
-
[SOLVED] Making A Hammer to break a 3X3 Block. Breaking two layers at a time now.
Well Thanks, That worked, it got to the middle but now it breaks two layer at a time, and I think it is because of the for loop, for the past 30 minutes I have been trying to get it to not do that, I tried changing the greater than signs around, messing around with min and max even more, and just doing other experimenting to it.
-
[SOLVED] Making A Hammer to break a 3X3 Block. Breaking two layers at a time now.
No, I got the breaking part to work. Just not the actual placement.
-
[SOLVED] Making A Hammer to break a 3X3 Block. Breaking two layers at a time now.
I am trying to make a Hammer in 1.12.2. I know, the regular, typical Hammer, once again in another mod. Overall I got the 3x3 Working, it breaks. Here is the code: public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (player.isSneaking()) { AxisAlignedBB grid = (new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), (pos.getX() + 3), (pos.getY() + 3), (pos.getZ() + 3))); for (int x = (int) grid.minX; x < (int) grid.maxX; x++) { for (int y = (int) grid.minY; y < (int) grid.maxY; y++) { for (int z = (int) grid.minZ; z < (int) grid.maxZ; z++) { BlockPos newpos = new BlockPos(x, y, z); if (worldIn.getBlockState(newpos).getBlock() != Blocks.AIR) { worldIn.destroyBlock(newpos, true); } } } } return EnumActionResult.PASS; } else if (!player.isSneaking()) { worldIn.destroyBlock(pos, true); return EnumActionResult.PASS; } return EnumActionResult.FAIL; } However I have been messing around with it and I did not get it to work in the sense that I wanted, which is starting from the middle and breaking top,down, left and right. I did try the top and down method. pos.up() pos.down() etc but that did not work when I did the whole facing checks. So it would be different for when I looked east, or when I looked north. I did fix that, but when I looked up or down, it did not. I guess it was because it checked player Horizontal Plane for Direction.. Anyway Results Below: Its starting from bottom left to top right. I have been trying to get it into the middle block and it does it around
IPS spam blocked by CleanTalk.