Jump to content

MCrafterzz

Members
  • Posts

    285
  • Joined

  • Last visited

Everything posted by MCrafterzz

  1. I've created a command that works like /fill but with a lot higher limit. So the most of the code is copyed but I get a weird error that I don't get from /fill Command: http://pastebin.com/yrnxzJGb Error: http://pastebin.com/pAPiftzU
  2. There is not methoud itemStack.getItem().rayTrace()
  3. What would the sideHit come from? There is no variable with that name
  4. Thank you very much I will continue tomorrow
  5. 1. What should I replace getHorizontalFacing with? 2. How should I fix the loop (please give a example) 3. I still don't really understand how to use the offset
  6. Updated again: http://pastebin.com/CkcQB7kA New crash: http://pastebin.com/7S6L8Swq
  7. Updated (I will use the block pos offset later): http://pastebin.com/AChu3XHQ
  8. Thank you for your reply but it crashed the game. Updated hammer class: http://pastebin.com/fFav0Z9L Crash: http://pastebin.com/5JjJ2scY
  9. This code will fix it: worldIn.destroyBlock(new BlockPos(x,y, z), true); true makes it drop items.
  10. I've created a hammer (3x3x1 pickaxe), and I've added a check to see that the block can be destroyed with that harvest level. But for some reason it doesn't work, when I printed it out both had a value of 0. How should I fix this? My code: http://pastebin.com/VtQuvkUD
  11. Hello, I've created a multitool, but it doesn't work on blocks from other mods, how should I fix it? My code: http://pastebin.com/fVL2DMi2
  12. A missed a , so I added it and it worked!
  13. I think the problem is that you havent set the texture for iron_shield_blocking.json, you need to do that, that would proberly solve the problem
  14. You need to add this for your shield to take damage when your blocking: @SubscribeEvent public void attackEvent(LivingAttackEvent e) { float damage = e.getAmount(); ItemStack activeItemStack; EntityPlayer player; if (!(e.getEntityLiving() instanceof EntityPlayer)) { return; } player = (EntityPlayer) e.getEntityLiving(); if (player.getActiveItemStack() == null) { return; } activeItemStack = player.getActiveItemStack(); if (damage > 0.0F && activeItemStack != null && activeItemStack.getItem() instanceof ItemShield) { int i = 1 + MathHelper.floor_float(damage); activeItemStack.damageItem(i, player); if (activeItemStack.stackSize <= 0) { EnumHand enumhand = player.getActiveHand(); net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, activeItemStack, enumhand); if (enumhand == EnumHand.MAIN_HAND) { player.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, (ItemStack) null); } else { player.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, (ItemStack) null); } activeItemStack = null; if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { player.playSound(SoundEvents.ITEM_SHIELD_BREAK, 0.8F, 0.8F + player.worldObj.rand.nextFloat() * 0.4F); } } } } And the problem with your texture could be that you need to add this: @Override public String getItemStackDisplayName(ItemStack stack) { return I18n.translateToLocal("item." + name + ".name"); } And take in a name variable because otherwise it will get a wierd name (Atleast it done it for me)
  15. Can you just say what I should change
  16. It can't find your class so post your main class and you reference class(If you have one)
  17. Can you upload the full source code? So I can see if theres any naming problems and stuff like that
  18. Do you know any tutorials on asm?
  19. Here is my source code for my mod witch add shields. Take a look at it and you will maybe relize what's wrong. https://github.com/MCrafterzz/minecraft-mod/blob/master/src.zip
×
×
  • Create New...

Important Information

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