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.

xXRoboJackXx

Members
  • Joined

  • Last visited

Everything posted by xXRoboJackXx

  1. It's not in the last code you posted. That was what I tried before I used the code you told me to use.
  2. Maybe read what I wrote? -.- Already tried that Unless I write it wrong.
  3. Maybe read what I wrote? -.- Already tried that Unless I write it wrong.
  4. Thanks but the par1World.editingBlocks = true; Is still not working. Thanks for the function one though, if anyone knows what I'm doing wrong on ^^ please tell me. Fixed it I was being a complete idiot sorry. Thanks everyone and how? Instead of explaining it here's the code Block Portal: Teleporter:
  5. Thanks but the par1World.editingBlocks = true; Is still not working. Thanks for the function one though, if anyone knows what I'm doing wrong on ^^ please tell me. Fixed it I was being a complete idiot sorry. Thanks everyone and how? Instead of explaining it here's the code Block Portal: Teleporter:
  6. And this is the file if you need to see it: package mods.blueeagle.common.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mods.blueeagle.common.mod.mod_TheGodMod; 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.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; 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 AngelBow extends Item { public static final String[] bowPullIconNameArray = new String[] {"bow_pull_0", "bow_pull_1", "bow_pull_2"}; @SideOnly(Side.CLIENT) private Icon[] iconArray; public AngelBow(int par1) { super(par1); this.maxStackSize = 1; this.setMaxDamage(384); this.setCreativeTab(CreativeTabs.tabCombat); } /** * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount */ 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); if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D); } 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; } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ 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; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } @Override public void updateIcons(IconRegister reg) { this.iconIndex = reg.registerIcon("blueeagle:AngelBow"); } public Icon getIconIndex(IconRegister reg, ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem != null && usingItem.getItem().itemID == mod_TheGodMod.AngelBow.itemID) { int X = usingItem.getMaxItemUseDuration() - useRemaining; if (X >= 18) this.iconIndex = reg.registerIcon("blueeagle:AngelBow1"); if (X > 13) this.iconIndex = reg.registerIcon("blueeagle:AngelBow2"); if (X > 0) this.iconIndex = reg.registerIcon("blueeagle:AngelBow3"); } return iconIndex; } } I would appreciate any help thanks in advanced.
  7. And this is the file if you need to see it: package mods.blueeagle.common.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mods.blueeagle.common.mod.mod_TheGodMod; 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.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; 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 AngelBow extends Item { public static final String[] bowPullIconNameArray = new String[] {"bow_pull_0", "bow_pull_1", "bow_pull_2"}; @SideOnly(Side.CLIENT) private Icon[] iconArray; public AngelBow(int par1) { super(par1); this.maxStackSize = 1; this.setMaxDamage(384); this.setCreativeTab(CreativeTabs.tabCombat); } /** * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount */ 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); if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D); } 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; } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ 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; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } @Override public void updateIcons(IconRegister reg) { this.iconIndex = reg.registerIcon("blueeagle:AngelBow"); } public Icon getIconIndex(IconRegister reg, ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem != null && usingItem.getItem().itemID == mod_TheGodMod.AngelBow.itemID) { int X = usingItem.getMaxItemUseDuration() - useRemaining; if (X >= 18) this.iconIndex = reg.registerIcon("blueeagle:AngelBow1"); if (X > 13) this.iconIndex = reg.registerIcon("blueeagle:AngelBow2"); if (X > 0) this.iconIndex = reg.registerIcon("blueeagle:AngelBow3"); } return iconIndex; } } I would appreciate any help thanks in advanced.
  8. This is my new code for the texture part of the bow: @Override public void updateIcons(IconRegister reg) { this.iconIndex = reg.registerIcon("blueeagle:AngelBow"); } public Icon getIconIndex(IconRegister reg, ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem != null && usingItem.getItem().itemID == mod_TheGodMod.AngelBow.itemID) { int X = usingItem.getMaxItemUseDuration() - useRemaining; if (X >= 18) this.iconIndex = reg.registerIcon("blueeagle:AngelBow1"); if (X > 13) this.iconIndex = reg.registerIcon("blueeagle:AngelBow2"); if (X > 0) this.iconIndex = reg.registerIcon("blueeagle:AngelBow3"); } return iconIndex; } Even though the icon for the bow itself works, the pulling the bow itself still doesn't. Anyone know how to fix this? There are no errors either.
  9. This is my new code for the texture part of the bow: @Override public void updateIcons(IconRegister reg) { this.iconIndex = reg.registerIcon("blueeagle:AngelBow"); } public Icon getIconIndex(IconRegister reg, ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem != null && usingItem.getItem().itemID == mod_TheGodMod.AngelBow.itemID) { int X = usingItem.getMaxItemUseDuration() - useRemaining; if (X >= 18) this.iconIndex = reg.registerIcon("blueeagle:AngelBow1"); if (X > 13) this.iconIndex = reg.registerIcon("blueeagle:AngelBow2"); if (X > 0) this.iconIndex = reg.registerIcon("blueeagle:AngelBow3"); } return iconIndex; } Even though the icon for the bow itself works, the pulling the bow itself still doesn't. Anyone know how to fix this? There are no errors either.
  10. I still have to fix the rest of the errors that the update gave me (Which is A LOT) I'll get back to you on it.
  11. Just realized I could copy the bow file and use it like this: package mods.blueeagle.common.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; 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 AngelBow extends Item { public static final String[] bowPullIconNameArray = new String[] {"bow_pull_0", "bow_pull_1", "bow_pull_2"}; @SideOnly(Side.CLIENT) private Icon[] iconArray; public AngelBow(int par1) { super(par1); this.maxStackSize = 1; this.setMaxDamage(384); this.setCreativeTab(CreativeTabs.tabCombat); } /** * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount */ 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); if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D); } 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; } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ 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; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } @SideOnly(Side.CLIENT) public void updateIcons(IconRegister par1IconRegister) { super.updateIcons(par1IconRegister); this.iconArray = new Icon[bowPullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = par1IconRegister.registerIcon(bowPullIconNameArray[i]); } } @SideOnly(Side.CLIENT) public Icon func_94599_c(int par1) { return this.iconArray[par1]; } } So now I'm guessing public static final String[] bowPullIconNameArray = new String[] {"bow_pull_0", "bow_pull_1", "bow_pull_2"}; Will search for the textures.
  12. kk so this code recognises bow_pull_0.png bow_pull_1.png bow_pull_2.png as the textures Thanks I'll go try it.
  13. No no no, I am 1.5 now I just only updated.
  14. Oh so don't I need separate textures for the bow anymore?
  15. I mean the texture like what happens when you right click aka the pulling.
  16. I just watched it and he said he'll make another video about it, so no I don't think it'll be part of it.
  17. Didn't help, I'm looking how to animate the bow. I know the rest.
  18. I have a feeling it's something like this public Icon getItemIcon(ItemStack par1ItemStack, int par2) { Icon icon = super.getItemIcon(par1ItemStack, par2); if (par1ItemStack.itemID == Item.fishingRod.itemID && this.fishEntity != null) { icon = Item.fishingRod.func_94597_g(); } else { if (par1ItemStack.getItem().requiresMultipleRenderPasses()) { return par1ItemStack.getItem().getIcon(par1ItemStack, par2); } if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID) { int j = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; if (j >= 18) { return Item.bow.func_94599_c(2); } if (j > 13) { return Item.bow.func_94599_c(1); } if (j > 0) { return Item.bow.func_94599_c(0); } } icon = par1ItemStack.getItem().getIcon(par1ItemStack, par2, this, itemInUse, itemInUseCount); } return icon; } Which I found in the entity player file but I wouldn't know what to change. (I know nearly everything but how to code a pulling texture :I)
  19. I've tried everything to try and mod a bow into 1.5.1 but I can't seem to find the right code for the icons when it's firing, I have everything else just not the bow pulling. So can anyone help me this is the code I have so far (Haven't updated since 1.4, The red glowing parts is what I need help changing, thanks in advance.
  20. Thanks but the par1World.editingBlocks = true; Is still not working. Thanks for the function one though, if anyone knows what I'm doing wrong on ^^ please tell me. Fixed it I was being a complete idiot sorry. Thanks everyone
  21. Thanks but the par1World.editingBlocks = true; Is still not working. Thanks for the function one though, if anyone knows what I'm doing wrong on ^^ please tell me.
  22. I looked in the world.java and couldn't find them so can anyone help?
  23. Oh sorry here's examples: EarthWand: BlockPortalHeaven What's glowing in red is the problem. Thanks
  24. If anyone can help there's a few things I need to know what a function changed to and what editingblocks changed to: func_94575_c this.field_85192_a.editingBlocks = true; (not the function the editingblocks) And that's it so, if anyone knows what the first function is and the editingblocks is please help me. Thanks in advance.
  25. I know how textures and the override stuff works, the problem is the icons for armor and the readying of the bow.

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.