Jump to content

triplec0re

Members
  • Posts

    3
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

triplec0re's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ah, thanks. Did not know about that.
  2. I did not intend to make it work on a server. Just want to become familiar with all the classes and methods. But it may be helpful in future, so thanks for that tip. And one more question there: How am I supposed to get the coordinates of the block the player is aiming at then? I added the if-condition !w.isRemote() and surprisingly it does work now, although I do not really understand why, because this condition should not change the field "isRemote" at all.
  3. Hey, I just started modding Minecraft. I want to create a pickaxe, which - on rightclick - harvests more than one block. Unfortunately I encountered two problems. The main problem is that the blocks get set to air, but you are still colliding with them. If I leave the world and rejoin, the blocks are reset to what they were before (dirt, stone, whatever). The second problem is that the block, the player is hovering over with his mouse, doesn't become air. Could you maybe take a look at my code (this is only for the player looking south)? I don't see any mistake, but maybe you do. @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World w, EntityPlayer player) { Minecraft mc = Minecraft.getMinecraft(); int x1; int y1; int z1; int damage = 0; if(mc.objectMouseOver != null) { x1 = mc.objectMouseOver.blockX; y1 = mc.objectMouseOver.blockY; z1 = mc.objectMouseOver.blockZ; if((MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3) == 0) { for(int xvar = x1-1; xvar < x1+2; xvar++) { for(int yvar = y1-1; yvar < y1+2; yvar++) { for(int zvar = z1; zvar < z1+4; zvar++) { Block block = w.getBlock(xvar, yvar, zvar); if(!block.isAir(w, xvar, yvar, zvar) && block.canHarvestBlock(player, w.getBlockMetadata(xvar, yvar, zvar)) && block.getMaterial() != Material.water && block.getMaterial() != Material.lava) { block.harvestBlock(w, player, xvar, yvar, zvar, w.getBlockMetadata(xvar, yvar, zvar)); w.setBlockToAir(xvar, yvar, zvar); player.addExhaustion(-0.025F); damage+=5; } } } } par1ItemStack.damageItem(damage, player); return par1ItemStack; }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.