
Monstrous_Apple
Members-
Posts
217 -
Joined
-
Last visited
Everything posted by Monstrous_Apple
-
You just said to copy and paste it...
-
I tried the new before and still got an error... so I took it out and uploaded that code because both gave an error... so what then? ModelBakery.registerItemVariants(MAItems.IronBow, new ModelResourceLocation(getModelLocation(), "IronBow_pulling_2")); The error is on getModelLocation
-
This gives me an error, so I take it I've still done something wrong... ModelBakery.registerItemVariants(MAItems.IronBow, ModelResourceLocation(getModelLocation(), "IronBow_pulling_2"));
-
Or could you show me an example if you don't mind?
-
Like this? Or no? Sorry I suck at this part... Also that gives an error so I'm sure that's not right so I have no clue ModelBakery.registerItemVariants(MAItems.IronBow, "IronBow_pulling_0");
-
How do I link it to the locations? Everything else on the code is correct right? ModelBakery.registerItemVariants(MAItems.ObsidianBow, names);
-
Opps, okay so I got this in there now, and it works but I'm not sure what else to put in? public ModelBakery.registerItemVariants(item, names); I mean I'm sure my bow goes in item and in names the pulling ones? Or what? Extremely stuck here...
-
I have no clue about this part of coding I've never done it, I've only done the basics so far... >.<
-
Yeah that's what I put, I just spelled it wrong when I typed on the forums however I don't think I'm doing it right, is this correct?: package com.MonstrousApple.mod.proxy; import com.MonstrousApple.mod.render.MABlockRender; import com.MonstrousApple.mod.render.MAGemRender; import com.MonstrousApple.mod.render.MAItemRender; import com.MonstrousApple.mod.render.MAOreRender; import net.minecraft.client.resources.model.ModelBakery; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ClientProxy extends CommonProxy { public void preInit(FMLPreInitializationEvent preEvent) { super.preInit(preEvent); ModelBakery.registerItemVariants } public void init(FMLInitializationEvent event) { super.init(event); MABlockRender.registerBlockRender(); MAItemRender.registerItemRender(); MAOreRender.registerOreRender(); MAGemRender.registerGemRender(); } public void postInit(FMLPostInitializationEvent postEvent) { super.postInit(postEvent); } } package com.MonstrousApple.mod.proxy; import com.MonstrousApple.mod.blocks.MABlocks; import com.MonstrousApple.mod.crafting.MACraftingRecipes; import com.MonstrousApple.mod.crafting.MARecipeRemover; import com.MonstrousApple.mod.crafting.MASmeltingRecipes; import com.MonstrousApple.mod.gems.MAGems; import com.MonstrousApple.mod.handler.MACraftingHandler; import com.MonstrousApple.mod.handler.MAFuelHandler; import com.MonstrousApple.mod.items.MAItems; import com.MonstrousApple.mod.items.foodsetup.MAFishing; import com.MonstrousApple.mod.ores.MAOres; import com.MonstrousApple.mod.world.MAWorldGen; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.init.Items; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; public class CommonProxy { public void preInit(FMLPreInitializationEvent preEvent) { MARecipeRemover.RemoveCraftingRecipe(Items.golden_apple, 1, 1); MARecipeRemover.RemoveCraftingRecipe(Items.fire_charge); ModelBakery.registerItemVariants; //MARecipeRemover.removeFurnace(new ItemStack(Items.iron_ingot)); MABlocks.initBlocks(); MAItems.initItems(); MAOres.initOres(); MAGems.initGems(); MACraftingRecipes.initRecipes(); MASmeltingRecipes.initSmelting(); MAFishing.addFish(); } public void init(FMLInitializationEvent event) { GameRegistry.registerWorldGenerator(new MAWorldGen(), 0); MinecraftForge.EVENT_BUS.register(new MACraftingHandler()); GameRegistry.registerFuelHandler(new MAFuelHandler()); } public void postInit(FMLPostInitializationEvent postEvent) { } }
-
I've tried that and it says "registerItemVarients cannot be resolved or is not a field"?
-
How do I register the pulling 0, 1 and 2? And where?
-
Okay so this time I have my bow firing arrows and everything is right, etc. But when I pull back the bow, it does change textures however it turns to the black and purple block textures (as if there was no texture for it), does anyone know why it does this? package com.MonstrousApple.mod.items.rangedweapons; import com.MonstrousApple.mod.MACreativeTabRangingWeapons; import com.MonstrousApple.mod.MAGlobal; import com.MonstrousApple.mod.items.MAItems; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.client.resources.model.ModelResourceLocation; 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.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemBow; import net.minecraft.stats.StatList; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class MAIronBow extends ItemBow { public MAIronBow(String unlocalizedName) { this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(MAGlobal.maCreativeTabRangingWeapons); //Maximum Amount In One Slot - Stack Size this.maxStackSize = 1; //Durability - How many uses //this.setMaxDamage(250); this.setMaxDamage(3); } /** * Get the location of the blockstates file used for this item's models * * @return The location */ public String getModelLocation() { return getRegistryName(); } @SideOnly(Side.CLIENT) @Override public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { if (player.isUsingItem()) { int useTime = stack.getMaxItemUseDuration() - useRemaining; if (useTime >= 18) { return new ModelResourceLocation(getModelLocation(), "IronBow_pulling_2"); } else if (useTime > 13) { return new ModelResourceLocation(getModelLocation(), "IronBow_pulling_1"); } else if (useTime > 0) { return new ModelResourceLocation(getModelLocation(), "IronBow_pulling_0"); } } return null; } { final String[] bowPullIconNameArray = new String[] {"IronBow_pulling_0", "IronBow_pulling_1", "IronBow_pulling_2"}; } /** * Called when the player stops using an Item (stops holding the right mouse button). */ public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft) { boolean flag = playerIn.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0; if (flag || playerIn.inventory.hasItem(MAItems.IronArrow)) { int i = this.getMaxItemUseDuration(stack) - timeLeft; net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(playerIn, stack, i); if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; i = event.charge; float f = (float)i / 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(worldIn, playerIn, f * 2.0F); if (f == 1.0F) { entityarrow.setIsCritical(true); } int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, stack); if (j > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D); } int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, stack); if (k > 0) { entityarrow.setKnockbackStrength(k); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, stack) > 0) { entityarrow.setFire(100); } stack.damageItem(1, playerIn); worldIn.playSoundAtEntity(playerIn, "random.bow", 1.0F, 1.0F); // /(itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (flag) { entityarrow.canBePickedUp = 2; } else { playerIn.inventory.consumeInventoryItem(MAItems.IronArrow); } playerIn.triggerAchievement(StatList.objectUseStats[item.getIdFromItem(this)]); if (!worldIn.isRemote) { worldIn.spawnEntityInWorld(entityarrow); } } } /** * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using * the Item before the action is complete. */ public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) { return stack; } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack stack) { return 72000; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.BOW; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(playerIn, itemStackIn); if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return event.result; if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(MAItems.IronArrow)) { playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); } return itemStackIn; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } }
-
Okay thanks I'll try that now, thanks for both of your help.
-
I'm on 1.8.9.
-
Yeah but I named it ObsidianBow_pulling_0, ObsidianBow_pulling_1 and ObsidianBow_pulling_2 because the bow colour is different. Edit: And yeah I tried putting "Obsidian" before the bow_pulling_0 etc before uploading my code.
-
Hey, so I have finally figured out how to make most of a bow, I have the textures done for the bow and the new arrow, however the only problem I'm having is making it so when I drawback my bow, it pulls the bow back like the normal bow, it does the animation but the string doesn't get pulled back, if that makes sense? package com.MonstrousApple.mod.items.rangedweapons; import com.MonstrousApple.mod.MACreativeTabRangingWeapons; import com.MonstrousApple.mod.MAGlobal; import com.MonstrousApple.mod.items.MAItems; 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.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.stats.StatList; import net.minecraft.world.World; public class MAObsidianBow extends Item { public MAObsidianBow(String unlocalizedName) { this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(MAGlobal.maCreativeTabRangingWeapons); } { final String[] bowPullIconNameArray = new String[] {"bow_pulling_0", "bow_pulling_1", "bow_pulling_2"}; } /** * Called when the player stops using an Item (stops holding the right mouse button). */ public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft) { boolean flag = playerIn.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0; if (flag || playerIn.inventory.hasItem(MAItems.ObsidianArrow)) { int i = this.getMaxItemUseDuration(stack) - timeLeft; net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(playerIn, stack, i); if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; i = event.charge; float f = (float)i / 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(worldIn, playerIn, f * 2.0F); if (f == 1.0F) { entityarrow.setIsCritical(true); } int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, stack); if (j > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D); } int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, stack); if (k > 0) { entityarrow.setKnockbackStrength(k); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, stack) > 0) { entityarrow.setFire(100); } stack.damageItem(1, playerIn); worldIn.playSoundAtEntity(playerIn, "random.bow", 1.0F, 1.0F); // /(itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (flag) { entityarrow.canBePickedUp = 2; } else { playerIn.inventory.consumeInventoryItem(MAItems.ObsidianArrow); } //playerIn.triggerAchievement(StatList.objectUseStats[item.getIdFromItem(this)]); if (!worldIn.isRemote) { worldIn.spawnEntityInWorld(entityarrow); } } } /** * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using * the Item before the action is complete. */ public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) { return stack; } /** * How long it takes to use or consume an item */ public int getMaxItemUseDuration(ItemStack stack) { return 72000; } /** * returns the action that specifies what animation to play when the items is being used */ public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.BOW; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(playerIn, itemStackIn); if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return event.result; if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(MAItems.ObsidianArrow)) { playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); } return itemStackIn; } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } }
-
Okay I'll take a look.
-
I have that already I'm just not sure what part of the wither skull attack to put into the code, I tried this: @Override public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) if(itemStackIn.getItem() == MAItems.NetherBlade) return super.onItemRightClick(itemStackIn, worldIn, playerIn); } private void launchWitherSkullToEntity(int p_82216_1_, EntityLivingBase p_82216_2_) { this.launchWitherSkullToCoords(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double)p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); } /** * Launches a Wither skull toward (par2, par4, par6) */ private void launchWitherSkullToCoords(int p_82209_1_, double x, double y, double z, boolean invulnerable) { this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, new BlockPos(this), 0); double d0 = this.func_82214_u(p_82209_1_); double d1 = this.func_82208_v(p_82209_1_); double d2 = this.func_82213_w(p_82209_1_); double d3 = x - d0; double d4 = y - d1; double d5 = z - d2; EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.worldObj, this, d3, d4, d5); if (invulnerable) { entitywitherskull.setInvulnerable(true); } entitywitherskull.posY = d1; entitywitherskull.posX = d0; entitywitherskull.posZ = d2; this.worldObj.spawnEntityInWorld(entitywitherskull); } }
-
Hey does anyone know how I would make it so that when I right click with my sword instead of blocking it would shoot out a fireball like a blaze and when "fully charged" would send out a wither skull attack? Thanks for any help given.
-
Hi I know this isn't exactly to do with forge but it's linked in a way and i'm wondering if anyone could help? I have been using eclipse for a while now but all of a sudden this error has appeared when I try to open eclipse: https://scontent-lhr3-1.xx.fbcdn.net/v/t34.0-12/13084066_996516863731530_490285722_n.png?oh=c32b1af264dc3811b18cef9f63577770&oe=5733DD05[/img]
-
[1.8] Custom mob drop with specific tools
Monstrous_Apple replied to MichaelVitrio's topic in Modder Support
Yes there is, if you actually watch the video, but you can't help but assume instead of actually looking into things properly. -
[1.8] Custom mob drop with specific tools
Monstrous_Apple replied to MichaelVitrio's topic in Modder Support
You really don't like me do you? Lol there's nothing wrong with having a one hour video for explaining how to make mobs and blocks drop different items always and also only when using specific tools, at least it's in clear and good detail rather than a one line answer. -
[1.8] Custom mob drop with specific tools
Monstrous_Apple replied to MichaelVitrio's topic in Modder Support
I have no clue how to do that but there is a guy named Neale that does tutorials and he has made a video on this: All credit to Neale of course. -
Oh okay thanks both for all the help, I did the new way you suggested and it works still.
-
How would I specify what items to have the glow on though, without making a new class?