Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

xwerswoodx

Forge Modder
  • Joined

  • Last visited

Everything posted by xwerswoodx

  1. where is your item? and what is id of it.
  2. Thanks for answer, I try to fix now Thanks for your help, I fixed it. Maybe someone wants to know how can I fix; package acidmod.functions; import acidmod.ref; import com.google.common.collect.Multimap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; public class addbow extends ItemBow { @SideOnly(Side.CLIENT) private Icon[] iconArray; private float bowDamage; private final EnumToolMaterial toolMaterial; public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; public addbow(int uid, String str, EnumToolMaterial material) { super(uid); this.toolMaterial = material; this.setCreativeTab(CreativeTabs.tabCombat); this.setUnlocalizedName(str); this.setMaxDamage(material.getMaxUses()); this.setMaxStackSize(1); this.bowDamage = (4.0F + material.getDamageVsEntity()) / 2; } public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { if (par2Block.blockID == Block.web.blockID) { return 15.0F; } else { Material material = par2Block.blockMaterial; return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.pumpkin ? 1.0F : 1.5F; } } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister reg) { this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)) + "_standby"); this.iconArray = new Icon[bowPullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)) + "_" + bowPullIconNameArray[i]); } } public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { int j = this.getMaxItemUseDuration(par1ItemStack) - par4; ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return; } j = event.charge; boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; if (flag || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID)) { float f = (float)j / 20.0F; f = (f * f + f * 2.0F) / 3.0F; if ((double)f < 0.1D) { return; } if (f > 1.0F) { f = 1.0F; } EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F); if (f == 1.0F) { entityarrow.setIsCritical(true); } int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); float h = this.bowDamage; if (h + k > 0) { if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D + (double)h); } else { entityarrow.setDamage(entityarrow.getDamage() + (double)h); } } int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); if (l > 0) { entityarrow.setKnockbackStrength(l); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) { entityarrow.setFire(100); } par1ItemStack.damageItem(1, par3EntityPlayer); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (flag) { entityarrow.canBePickedUp = 2; } else { par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID); } if (!par2World.isRemote) { par2World.spawnEntityInWorld(entityarrow); } } } public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { return par1ItemStack; } public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return event.result; } if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID)) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); } return par1ItemStack; } public int getItemEnchantability() { return 1; } public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } public Multimap getItemAttributeModifiers() { Multimap multimap = super.getItemAttributeModifiers(); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Bow modifier", (double)this.bowDamage, 0)); return multimap; } } I change power ench. code with; float h = this.bowDamage; if (h + k > 0) { if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D + (double)h); } else { entityarrow.setDamage(entityarrow.getDamage() + (double)h); } } But this was too much because all bows started to hit 1 times and I divide 2, bow damage; this.bowDamage = (4.0F + material.getDamageVsEntity()) / 2; I know my eng. is not very well but I tried to explain how can you do. Thanks for your help again.
  3. Hello everyone, Firstly, if same topic was opened, I'm very sorry about this. I searched but can't find it. I did some bows for minecraft. package acidmod.functions; import acidmod.ref; import com.google.common.collect.Multimap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; public class addbow extends ItemBow { @SideOnly(Side.CLIENT) private Icon[] iconArray; private float bowDamage; private final EnumToolMaterial toolMaterial; public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; public addbow(int uid, String str, EnumToolMaterial material) { super(uid); this.toolMaterial = material; this.setCreativeTab(CreativeTabs.tabCombat); this.setUnlocalizedName(str); this.setMaxDamage(material.getMaxUses()); this.setMaxStackSize(1); this.bowDamage = 4.0F + material.getDamageVsEntity(); } public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { if (par2Block.blockID == Block.web.blockID) { return 15.0F; } else { Material material = par2Block.blockMaterial; return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.pumpkin ? 1.0F : 1.5F; } } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister reg) { this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)) + "_standby"); this.iconArray = new Icon[bowPullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)) + "_" + bowPullIconNameArray[i]); } } public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } public Multimap getItemAttributeModifiers() { Multimap multimap = super.getItemAttributeModifiers(); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Bow modifier", (double)this.bowDamage, 0)); return multimap; } } this.stoneBow = new addbow(stoneBowID, "stonebow", EnumToolMaterial.STONE); this.ironBow = new addbow(ironBowID, "ironbow", EnumToolMaterial.IRON); this.goldBow = new addbow(goldBowID, "goldbow", EnumToolMaterial.GOLD); this.diamondBow = new addbow(diamondBowID, "diamondbow", EnumToolMaterial.EMERALD); Every think works correctly, but when I attack some mobs with bow, it kill 3 times, and with diamond 3 times, too. So I think damage doesn't works correctly, and how can I see, how many damages do mobs take? or how can I fix?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.