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.

Jetfan16ladd

Members
  • Joined

  • Last visited

Everything posted by Jetfan16ladd

  1. No I am still getting the same errors. But I will post my code for both of the entitys. EntityRpg: package com.mineturnedmod.mineturned; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityRpg extends EntityThrowable { private double explosionRadius = 3.0F; /** * @param par1World where the entity will spawn */ public EntityRpg(World par1World) { super(par1World); } /** * @param par1World * @param arg1Double * @param arg2Double * @param arg3Double */ public EntityRpg(World par1World, double arg1Double, double arg2Double, double arg3Double) { super(par1World, arg1Double, arg2Double, arg3Double); } /** * @param par1World * @param arg1EntityLivingBase */ public EntityRpg(World par1World, EntityLivingBase arg1EntityLivingBase) { super(par1World, arg1EntityLivingBase); } @Override protected float getGravityVelocity() { return 0; } /** * @see net.minecraft.entity.projectile.EntityThrowable#onImpact(net.minecraft.util.MovingObjectPosition) */ @Override protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true); this.setDead(); } } EntityExplosiveArrow: package com.mineturnedmod.mineturned; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityExplosiveArrow extends EntityThrowable { private double explosionRadius = 3.0F; /** * @param par1World where the entity will spawn */ public EntityExplosiveArrow(World par1World) { super(par1World); } /** * @param par1World * @param arg1Double * @param arg2Double * @param arg3Double */ public EntityExplosiveArrow(World par1World, double arg1Double, double arg2Double, double arg3Double) { super(par1World, arg1Double, arg2Double, arg3Double); } /** * @param par1World * @param arg1EntityLivingBase */ public EntityExplosiveArrow(World par1World, EntityLivingBase arg1EntityLivingBase) { super(par1World, arg1EntityLivingBase); } /** * @see net.minecraft.entity.projectile.EntityThrowable#onImpact(net.minecraft.util.MovingObjectPosition) */ @Override protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true); this.setDead(); } }
  2. I am trying to render 2 different entitys however I keep getting the same texture on both entitys. Here is the Client Proxy Class: package com.mineturnedmod.mineturned; import net.minecraft.client.renderer.entity.RenderSnowball; import cpw.mods.fml.client.registry.RenderingRegistry;public class ArrowClient extends ArrowCommon { @Override public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(EntityRpg.class, new RenderSnowball(Mineturnedmain.RpgAmmo)); RenderingRegistry.registerEntityRenderingHandler(EntityExplosiveArrow.class, new RenderSnowball(Mineturnedmain.EAT)); } @Override public void registerSounds() {} } Here is the the main class: package com.mineturnedmod.mineturned; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = Mineturnedmain.MODID, name = Mineturnedmain.NAME, version = Mineturnedmain.VERSION) public class Mineturnedmain { @SidedProxy(clientSide = "com.mineturnedmod.mineturned.ArrowClient", serverSide = "com.mineturnedmod.mineturned.proxies.ArrowCommon") public static ArrowCommon proxy; public static final String MODID = "realisticcrafting"; public static final String NAME = "More Crafting"; public static final String VERSION = "1.0"; public static CreativeTabs MoreCraftingTab = new CreativeTabs("MoreCraftingTab"){ public Item getTabIconItem(){ return Rpg; } }; //Blocks public static Block BlockOfTin = new BlockOfTinClass(3000, Material.iron).setBlockName("BlockOfTin") .setBlockTextureName(Mineturnedmain.MODID + ":BlockOfTin"); public static Block BlockOfCopper = new BlockOfCopperClass(3000, Material.iron).setBlockName("BlockOfCopper") .setBlockTextureName(Mineturnedmain.MODID + ":BlockOfCopper"); public static Block TinOre = new TinOreClass(3001, Material.rock).setBlockName("TinOre"); public static Block CopperOre = new CopperOreClass(3001, Material.rock).setBlockName("CopperOre"); //Items public static Item TinIngot = new TinIngotClass(3002).setUnlocalizedName("TinIngot"); public static Item Spear = new SpearClass().setUnlocalizedName("Spear").setCreativeTab(MoreCraftingTab); public static Item PocketKnife = new PocketKnifeClass(3004, Item.ToolMaterial.IRON).setUnlocalizedName("PocketKnife").setCreativeTab(MoreCraftingTab); public static Item CopperIngot = new CopperIngotClass(3003).setUnlocalizedName("CopperIngot"); public static Item sledgehammer = new sledgehammerClass(3005, Item.ToolMaterial.EMERALD).setUnlocalizedName("sledgehammer").setCreativeTab(MoreCraftingTab); public static Item Rpg = new RpgClass().setUnlocalizedName("Rpg").setCreativeTab(MoreCraftingTab); public static Item EAT = new EATClass(3009).setUnlocalizedName("EAT"); public static Item GreenBow = new GreenBowClass().setUnlocalizedName("GreenBow").setCreativeTab(MoreCraftingTab); public static Item GreenBow2 = new GreenBow2Class().setUnlocalizedName("GreenBow2").setCreativeTab(MoreCraftingTab); public static Item RpgAmmo = new RpgAmmoClass(3006).setUnlocalizedName("RpgAmmo").setCreativeTab(MoreCraftingTab); public static Item Mirakuru = new MirakuruClass(4, 0.75f, false).setUnlocalizedName("Mirakuru").setCreativeTab(MoreCraftingTab).setMaxStackSize(1); public static Item Cure = new CureClass().setUnlocalizedName("Cure").setCreativeTab(MoreCraftingTab).setMaxStackSize(1); public Mineturnedmain(){ GameRegistry.registerBlock(BlockOfTin,"BlockOfTin"); GameRegistry.registerBlock(TinOre, "TinOre"); GameRegistry.registerBlock(CopperOre, "CopperOre"); GameRegistry.registerItem(TinIngot, "TinIngot"); GameRegistry.registerItem(CopperIngot, "CopperIngot"); GameRegistry.registerItem(Rpg, "Rpg"); GameRegistry.registerItem(Cure, "Cure"); GameRegistry.registerItem(EAT, "EAT"); GameRegistry.registerItem(Mirakuru, "Mirakuru"); GameRegistry.registerItem(RpgAmmo, "RpgAmmo"); GameRegistry.registerItem(GreenBow, "GreenBow"); GameRegistry.registerItem(GreenBow2, "GreenBow2"); GameRegistry.registerBlock(BlockOfCopper,"BlockOfCopper"); //Crafting and Smelting GameRegistry.addSmelting(Mineturnedmain.TinOre, new ItemStack(Mineturnedmain.TinIngot), 0.5f); GameRegistry.addSmelting(Mineturnedmain.CopperOre, new ItemStack(Mineturnedmain.CopperIngot), 0.5f); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.BlockOfCopper), new Object[]{"xxx","xxx","xxx",'x', Mineturnedmain.CopperIngot}); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.BlockOfTin), new Object[]{"xxx","xxx","xxx",'x', Mineturnedmain.TinIngot}); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.CopperIngot, 9), new Object[]{"x",'x', Mineturnedmain.BlockOfCopper}); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.TinIngot, 9), new Object[]{"x",'x', Mineturnedmain.BlockOfTin}); } @EventHandler public void preinit(FMLPreInitializationEvent event){ GameRegistry.registerWorldGenerator(new WorldGeneratorAvatar(), 1); } @EventHandler public void init(FMLInitializationEvent event){ EntityRegistry.registerModEntity(EntityRpg.class, "Rpg", 4, this, 80, 3, true); EntityRegistry.registerModEntity(EntityExplosiveArrow.class, "EAT", 4, this, 80, 3, true); proxy.registerRenderThings(); proxy.registerSounds(); } }
  3. How do I make just the arrows explosion have a delay?
  4. I made it extend arrow and now it crash's when ever I use the bow. Here is the bow class: package com.mineturnedmod.mineturned; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; 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 GreenBow2Class extends Item { public static final String[] bowPullIconNameArray = new String[] {"bow_pulling_0", "bow_pulling_1", "bow_pulling_2"}; @SideOnly(Side.CLIENT) private IIcon[] iconArray; private static final String __OBFID = "CL_00001777"; public GreenBow2Class() { 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 p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return; } j = event.charge; boolean flag = p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; if (flag || p_77615_3_.inventory.hasItem(Items.arrow)) { 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; } EntityExplosiveArrow EntityExplosiveArrow = new EntityExplosiveArrow(p_77615_2_, p_77615_3_); if (f == 1.0F) { } int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, p_77615_1_); if (k > 0) { } int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, p_77615_1_); if (l > 0) { } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, p_77615_1_) > 0) { EntityExplosiveArrow.setFire(100); } p_77615_1_.damageItem(1, p_77615_3_); p_77615_2_.playSoundAtEntity(p_77615_3_, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (flag) { } else { p_77615_3_.inventory.consumeInventoryItem(Items.arrow); } if (!p_77615_2_.isRemote) { p_77615_2_.spawnEntityInWorld(EntityExplosiveArrow); } } } public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { return p_77654_1_; } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack p_77626_1_) { return 82000; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack p_77661_1_) { return EnumAction.bow; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return event.result; } if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(Items.arrow)) { p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); } return p_77659_1_; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem == null) { return itemIcon; } int ticksInUse = stack.getMaxItemUseDuration() - useRemaining; if (ticksInUse > 1) { return iconArray[2]; } else if (ticksInUse > 13) { return iconArray[1]; } else if (ticksInUse > 0) { return iconArray[0]; } else { return itemIcon; } } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister){ iconArray = new IIcon[4]; iconArray[0] = iconRegister.registerIcon("morecraftingmod:bow_standby"); iconArray[1] = iconRegister.registerIcon("morecraftingmod:bow_pulling_0"); iconArray[2] = iconRegister.registerIcon("morecraftingmod:bow_pulling_1"); iconArray[3] = iconRegister.registerIcon("morecraftingmod:bow_pulling_2"); this.itemIcon = iconRegister.registerIcon("morecraftingmod:bow_standby"); } /** * used to cycle through icons based on their used duration, i.e. for the bow */ @SideOnly(Side.CLIENT) public IIcon getItemIconForUseDuration(int p_94599_1_) { return this.iconArray[p_94599_1_]; } } Here is the Arrow class: package com.mineturnedmod.mineturned; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.world.World; public class EntityExplosiveArrow extends EntityArrow{ private double explosionRadius = 3.0F; public EntityExplosiveArrow(World p_i1773_1_) { super(p_i1773_1_); } public EntityExplosiveArrow(World p_i1774_1_, EntityLivingBase p_i1774_2_) { super(p_i1774_1_); } public EntityExplosiveArrow(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); } protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { try { Thread.sleep(2000); //1000 milliseconds is one second. } catch(InterruptedException ex) { Thread.currentThread().interrupt(); } this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true); this.setDead(); } } The error that I keep on getting in the console is AL lib: (EE) alc_cleanup: 1 device not closed
  5. The only problem I have is that when I extend entityarrow it doesn't let me use @override before onimpact. Also I am not sure what constructors to use.
  6. Where do u put what the key does?
  7. For my mod I want to make a item that on "f" key pressed will despawn the item and give the player a different item. How is this done?
  8. I want to create a custom arrow for my mod and I have a few questions. M first question is: Is there anyway to make a arrow that explodes 3 seconds after hits something? Also is there a way to make it so that on contact with a entity it gives a potion effect to the entity. I have not found any tutorials on how to render the arrow( When I shoot the bow I want to actually see the arrow). If u know of a tutorial or a way to do any of these things please post here.
  9. I have another question. When I eat the food I only get the potion effects for 1:30min. Can I make it longer?
  10. I have been following a youtube tutorial on how to make food with potion effects. However I cant get more than one to work at a time. Here is my code; public class MirakuruClass extends ItemFood{ public MirakuruClass(int hunger, float saturation, boolean IsWolfFood) { super(hunger, saturation, IsWolfFood); this.setPotionEffect(Potion.regeneration.id, 1800, 10, 1.0f); } protected void onfoodEaten(ItemStack itemstack, World world, EntityPlayer player){ player.addPotionEffect(new PotionEffect(Potion.resistance.id, 1800, 10)); player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 1800, 10)); }}
  11. I have another question. Is there a way to make the play fall backward when u right click?
  12. When I shot the rpg the bullet is invisible so I want to see it. I works fine and explodes on impact but I want to see the bullets.
  13. I am trying to make a rpg that explodes on impact. I used the tutorials and it works fine but I cannot get the bullet to render. I tried using the tutorials but they are out dated and I cannot find specific tutorial for rendering. I have found a lot of mob tutorials but not a rendering tutorial. If u have a tutorial or video u can link me to that would be great.
  14. Okay but how do I edit the zombie entity files?
  15. Is there anyway to make zombies not burn in daylight or edit the minecraft reference files as I cant type or edit them. I am making a zombie apocalypse mod.
  16. I am pretty new to modding and a bit of a noob. I want to make an alloy furnace for my mod but I don't even know where to start. I want it to be similar to the Orc Forge or the Dwarf Forge in the lord of the rings mod. I want it to be so you put an ingot in one spot and an alloy in another spot to make a new ingot. example Iron and Lime stone to make pig iron.
  17. im a noob so how can I do the TileEntity thingy or block updates
  18. Is there any way to make a block the only emits light at night and does not emit light during the day? please post ideas on how this can be done
  19. I tried that code for the rendering but am getting like 10 errors and idk how to fix them
  20. I don't understand how proxy's work yet as I am new to modding and have watch most of the 1.7.2 tutorials. how do the proxy's work and how do u set it up?
  21. I know there r other part I don't care about the amount of damage yet I will get there later but I am saying is I want to at least get part 1 to work as it doesn't appear still etc.. can someone test or look at the code and tell me why it is not working
  22. I tried matching the parameters and when I test it I can hear the sound but I cant see it and it doesn't do damage to mobs. the Magnum Class is the same but here is the new EntityMagnumBullet Class package com.halo.halomod; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityMagnumBullet extends EntityThrowable { public EntityMagnumBullet(World par1World) { super(par1World); } public EntityMagnumBullet(World par1World, EntityPlayer par2EntityPlayer) { super(par1World, par2EntityPlayer); } public EntityMagnumBullet(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } @Override protected void onImpact(MovingObjectPosition movingobjectposition){ // TODO Auto-generated method stub } }

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.