package net.minecraft.src;
import java.util.Random;
public class ItemBowIron extends Item
{
public ItemBowIron(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(384);
this.setTabToDisplayOn(CreativeTabs.tabCombat);
}
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
EntityPlayer entityplayer = (EntityPlayer)entity;
ItemStack itemstack1 = entityplayer.inventory.getCurrentItem();
if(entityplayer.isUsingItem() && itemstack1.itemID == mod_EmeraldPlus.bowIron.shiftedIndex)
{
int k = itemstack.getMaxItemUseDuration() - entityplayer.getItemInUseCount();
if (k >= 18) {
iconIndex = mod_EmeraldPlus.bowIron4;} else if(k > 13) {
iconIndex = mod_EmeraldPlus.bowIron3;} else if(k > 0) {
iconIndex = mod_EmeraldPlus.bowIron2;}
} else {
iconIndex = mod_EmeraldPlus.bowIron1;}
}
/**
* 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)
{
boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
float var7 = (float)var6 / 20.0F;
var7 = (var7 * var7 + var7 * 2.0F) / 3.0F;
if ((double)var7 < 0.1D)
{
return;
}
if (var7 > 1.0F)
{
var7 = 1.0F;
}
EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F);
if (var7 == 1.0F)
{
var8.func_70243_d(true);
}
int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (var9 > 0)
{
var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D);
}
int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (var10 > 0)
{
var8.setKnockbackStrength(var10);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
{
var8.setFire(100);
}
par1ItemStack.damageItem(1, par3EntityPlayer);
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F);
if (var5)
{
var8.canBePickedUp = 2;
}
else
{
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex);
}
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(var8);
}
}
}
public ItemStack onFoodEaten(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)
{
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
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;
}
}
with the basic block tuturial when i try to to play the game after compiling and instaling my mod, minecraft crashes and i get modloader failed to inistalize. after some work i whiletled the problem down to my mod_teleBlock.java/class file
package net.minecraft.src;
public class mod_teleBlock extends BaseMod
{
public static final Block tele = new BlockTele(2000, 0).setBlockName("anytele").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
//tele.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tex/teleBlock/teleBlock.png");
ModLoader.registerBlock(tele);ModLoader.addName(tele, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(tele, 1), new Object []
{"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.3.2";
}
}
when I make a block the material is always stone no matter what I put as the material.
heres My code
package net.minecraft.src;
import java.util.Random;
public class reinforcedWool extends Block{
public reinforcedWool(int i, int j)
{
super(i, j, Material.cloth);
}
public int idDropped(int i, Random random, int j)
{
return mod_RocketCraft.reinforcedWool.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
package net.minecraft.src;
import java.util.Random;
public class ItemBowIron extends Item
{
public ItemBowIron(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(384);
this.setTabToDisplayOn(CreativeTabs.tabCombat);
}
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
EntityPlayer entityplayer = (EntityPlayer)entity;
ItemStack itemstack1 = entityplayer.inventory.getCurrentItem();
if(entityplayer.isUsingItem() && itemstack1.itemID == mod_EmeraldPlus.bowIron.shiftedIndex)
{
int k = itemstack.getMaxItemUseDuration() - entityplayer.getItemInUseCount();
if (k >= 18) {
iconIndex = mod_EmeraldPlus.bowIron4;} else if(k > 13) {
iconIndex = mod_EmeraldPlus.bowIron3;} else if(k > 0) {
iconIndex = mod_EmeraldPlus.bowIron2;}
} else {
iconIndex = mod_EmeraldPlus.bowIron1;}
}
/**
* 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)
{
boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
float var7 = (float)var6 / 20.0F;
var7 = (var7 * var7 + var7 * 2.0F) / 3.0F;
if ((double)var7 < 0.1D)
{
return;
}
if (var7 > 1.0F)
{
var7 = 1.0F;
}
EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F);
if (var7 == 1.0F)
{
var8.func_70243_d(true);
}
int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (var9 > 0)
{
var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D);
}
int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (var10 > 0)
{
var8.setKnockbackStrength(var10);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
{
var8.setFire(100);
}
par1ItemStack.damageItem(1, par3EntityPlayer);
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F);
if (var5)
{
var8.canBePickedUp = 2;
}
else
{
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex);
}
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(var8);
}
}
}
public ItemStack onFoodEaten(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)
{
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
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;
}
}
I thought the damage factor is in your arrow class :DHey would the Forge TUTs come after all of the things on ur list?
NNNNOOOOOOOOO!!!!!!!!!! NOT FORGE TUTORIALS!! PLEASE NO!!!!! HOW AM I SUPOSED TO MAKE A MOD THEN?!?!??!
Like a normal texture! Like if you make a block.
By using Forge, or using the ModLoader tutorials that are still going to be there.
Or use Forge.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
How do I put cocoa beans on a shapeless recipe? I'm getting this error
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Diego Granada\Desktop\mcp72\jars\.\crash-reports\crash-2012-08-24_21.23.47-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 84f2ee --------
Generated 8/24/12 9:23 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 994663456 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 3
ModLoader 1.3.2
mod_ApplePieNathan 1.3.2
mod_BrownieJoaco 1.3.2
java.lang.RuntimeException: Invalid shapeless recipy!
at net.minecraft.src.CraftingManager.addShapelessRecipe(CraftingManager.java:222)
at net.minecraft.src.ModLoader.addShapelessRecipe(ModLoader.java:512)
at net.minecraft.src.mod_BrownieJoaco.load(mod_BrownieJoaco.java:10)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b8e807d9 ----------
And this is my code
package net.minecraft.src;
public class mod_BrownieJoaco extends BaseMod
{
public static final Item brownie = new ItemFood(5002, 6, 5F, false).setItemName("anybrownie");
public void load()
{
brownie.iconIndex = ModLoader.addOverride("/gui/items.png", "/brownie.png");
ModLoader.addName(brownie, "Brownie con leche");
ModLoader.addShapelessRecipe(new ItemStack(brownie, 1), new Object[]
{Item.sugar, Item.bucketMilk, Item.egg, Item.dyePowder, 1, 3});
}public String getVersion()
{
return "1.3.2";
}
}
How do I put cocoa beans on a shapeless recipe? I'm getting this error
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Diego Granada\Desktop\mcp72\jars\.\crash-reports\crash-2012-08-24_21.23.47-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 84f2ee --------
Generated 8/24/12 9:23 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 994663456 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 3
ModLoader 1.3.2
mod_ApplePieNathan 1.3.2
mod_BrownieJoaco 1.3.2
java.lang.RuntimeException: Invalid shapeless recipy!
at net.minecraft.src.CraftingManager.addShapelessRecipe(CraftingManager.java:222)
at net.minecraft.src.ModLoader.addShapelessRecipe(ModLoader.java:512)
at net.minecraft.src.mod_BrownieJoaco.load(mod_BrownieJoaco.java:10)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b8e807d9 ----------
And this is my code
package net.minecraft.src;
public class mod_BrownieJoaco extends BaseMod
{
public static final Item brownie = new ItemFood(5002, 6, 5F, false).setItemName("anybrownie");
public void load()
{
brownie.iconIndex = ModLoader.addOverride("/gui/items.png", "/brownie.png");
ModLoader.addName(brownie, "Brownie con leche");
ModLoader.addShapelessRecipe(new ItemStack(brownie, 1), new Object[]
{Item.sugar, Item.bucketMilk, Item.egg, Item.dyePowder, 1, 3});
}public String getVersion()
{
return "1.3.2";
}
}
it should just pull the right texture from the path the mod_ file specifies. Then it just projects the texture in the shape the blockmod file specifies.
package net.minecraft.src;
import java.util.Random;
public class ItemBowIron extends Item
{
public ItemBowIron(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(384);
this.setTabToDisplayOn(CreativeTabs.tabCombat);
}
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
EntityPlayer entityplayer = (EntityPlayer)entity;
ItemStack itemstack1 = entityplayer.inventory.getCurrentItem();
if(entityplayer.isUsingItem() && itemstack1.itemID == mod_EmeraldPlus.bowIron.shiftedIndex)
{
int k = itemstack.getMaxItemUseDuration() - entityplayer.getItemInUseCount();
if (k >= 18) {
iconIndex = mod_EmeraldPlus.bowIron4;} else if(k > 13) {
iconIndex = mod_EmeraldPlus.bowIron3;} else if(k > 0) {
iconIndex = mod_EmeraldPlus.bowIron2;}
} else {
iconIndex = mod_EmeraldPlus.bowIron1;}
}
/**
* 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)
{
boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
float var7 = (float)var6 / 20.0F;
var7 = (var7 * var7 + var7 * 2.0F) / 3.0F;
if ((double)var7 < 0.1D)
{
return;
}
if (var7 > 1.0F)
{
var7 = 1.0F;
}
EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F);
if (var7 == 1.0F)
{
var8.func_70243_d(true);
}
int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (var9 > 0)
{
var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D);
}
int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (var10 > 0)
{
var8.setKnockbackStrength(var10);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
{
var8.setFire(100);
}
par1ItemStack.damageItem(1, par3EntityPlayer);
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F);
if (var5)
{
var8.canBePickedUp = 2;
}
else
{
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex);
}
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(var8);
}
}
}
public ItemStack onFoodEaten(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)
{
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
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;
}
}
Find this line in your bow class: EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F); and edit 2.0F to anything you like. Higher means more damage.
The Meaning of Life, the Universe, and Everything.
Join Date:
8/20/2012
Posts:
51
Member Details
Recipe problem, want my recipe to be jungle planks, but can't get it to work
Code:
Tried 2 differemt things:
package net.minecraft.src;
import java.util.Random;
public class mod_LotsofStuff extends BaseMod
{
public static final Item DiamondNugget = new Item(3000).setItemName("DiamondNugget");
public static final Item Chocolate = new ItemFood(3001, 4, 1F, false).setItemName("Chocolate");
public static final Block JungleBook = new BlockJungleBook(171, 0).setBlockName("JungleBook").setHardness(1.5F).setCreativeTab(CreativeTabs.tabBlock);
public static int JungleBookBottom = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBbottom.png");
public static int JungleBookTop = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBtop.png");
public static int JungleBookSides = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBsides.png");
public void load()
{
ModLoader.registerBlock(JungleBook);
ModLoader.addName(DiamondNugget, "Diamond Nugget");
ModLoader.addName(Chocolate, "Chocolate");
ModLoader.addName(JungleBook, "Jungle BookShelf");
ModLoader.addOverride("/gui/items.png", "LotsofStuff/Chocolate.png");
ModLoader.addOverride("/gui/items.png", "LotsofStuff/DiamondNugget.png");
ModLoader.addRecipe(new ItemStack(JungleBook, 1), new Object [] {"###", "$$$", "###", Character.valueOf('$'), Item.book, Character.valueOf('#'), Block.planks, 3});
}
public String getVersion()
{
return "1.3.1";
}
}
And:
package net.minecraft.src;
import java.util.Random;
public class mod_LotsofStuff extends BaseMod
{
public static final Item DiamondNugget = new Item(3000).setItemName("DiamondNugget");
public static final Item Chocolate = new ItemFood(3001, 4, 1F, false).setItemName("Chocolate");
public static final Block JungleBook = new BlockJungleBook(171, 0).setBlockName("JungleBook").setHardness(1.5F).setCreativeTab(CreativeTabs.tabBlock);
public static int JungleBookBottom = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBbottom.png");
public static int JungleBookTop = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBtop.png");
public static int JungleBookSides = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBsides.png");
public void load()
{
ModLoader.registerBlock(JungleBook);
ModLoader.addName(DiamondNugget, "Diamond Nugget");
ModLoader.addName(Chocolate, "Chocolate");
ModLoader.addName(JungleBook, "Jungle BookShelf");
ModLoader.addOverride("/gui/items.png", "LotsofStuff/Chocolate.png");
ModLoader.addOverride("/gui/items.png", "LotsofStuff/DiamondNugget.png");
ModLoader.addRecipe(new ItemStack(JungleBook, 1), new Object [] {"###", "$$$", "###", Character.valueOf('$'), Item.book, Character.valueOf('#'), Block.planks, 1, 3});
}
public String getVersion()
{
return "1.3.1";
}
}
I figured it out; instead of setCreativeTab( ) you use setTabToDisplayOn( ). You might want to include that in your tutorial, as it is something fairly basic that most mod developers need to know.
try Searching existing files, this time it would be the CraftingMananger. well, I kinda checked for you today so it's like this:
ModLoader.addRecipe(new ItemStack(Block.dirt,1), new Object [] {"X", 'X', new ItemStack(Block.planks, 1, 3)});
Thanks!
But when i test it with my recipe it makes a normal bookshelf instead of my Jungle BookShelf I've looked in the CraftingManager file and the BlockBookShelf file but i can't find out what to do
i had the image as a jpg derp
package net.minecraft.src; import java.util.Random; public class ItemBowIron extends Item { public ItemBowIron(int par1) { super(par1); maxStackSize = 1; setMaxDamage(384); this.setTabToDisplayOn(CreativeTabs.tabCombat); } public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { EntityPlayer entityplayer = (EntityPlayer)entity; ItemStack itemstack1 = entityplayer.inventory.getCurrentItem(); if(entityplayer.isUsingItem() && itemstack1.itemID == mod_EmeraldPlus.bowIron.shiftedIndex) { int k = itemstack.getMaxItemUseDuration() - entityplayer.getItemInUseCount(); if (k >= 18) { iconIndex = mod_EmeraldPlus.bowIron4;} else if(k > 13) { iconIndex = mod_EmeraldPlus.bowIron3;} else if(k > 0) { iconIndex = mod_EmeraldPlus.bowIron2;} } else { iconIndex = mod_EmeraldPlus.bowIron1;} } /** * 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) { boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) { int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4; float var7 = (float)var6 / 20.0F; var7 = (var7 * var7 + var7 * 2.0F) / 3.0F; if ((double)var7 < 0.1D) { return; } if (var7 > 1.0F) { var7 = 1.0F; } EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F); if (var7 == 1.0F) { var8.func_70243_d(true); } int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); if (var9 > 0) { var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D); } int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); if (var10 > 0) { var8.setKnockbackStrength(var10); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) { var8.setFire(100); } par1ItemStack.damageItem(1, par3EntityPlayer); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F); if (var5) { var8.canBePickedUp = 2; } else { par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex); } if (!par2World.isRemote) { par2World.spawnEntityInWorld(var8); } } } public ItemStack onFoodEaten(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) { if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) { 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; } }Your texture is commented out.
heres My code
package net.minecraft.src;
import java.util.Random;
public class reinforcedWool extends Block{
public reinforcedWool(int i, int j)
{
super(i, j, Material.cloth);
}
public int idDropped(int i, Random random, int j)
{
return mod_RocketCraft.reinforcedWool.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Code:
package net.minecraft.src; import java.util.Random; public class mod_Lightdirt extends BaseMod { //Light Ingot// public static final Item LightIngot=new ItemLightIngot(5000).setItemName("Light Ingot"); //Light Ingot// //Lightdirt// public static final Block Lightdirt = new BlockLightdirt (160, 0) .setBlockName("Lightdirt").setHardness(0.5F).setLightValue(1.0F) .setCreativeTab(CreativeTabs.tabBlock); //Lightdirt //Lightonium Ore// public static final Block LightOre = new BlockLightOre (161, 0) .setLightValue(0.8F).setHardness(3F).setResistance(5F).setBlockName("LightOre"); //Lightonium Ore// public void load() { //Light Ingot// LightIngot.iconIndex=ModLoader.addOverride("/gui/items.png", "/LightIngot.png"); ModLoader.addName(LightIngot, "Light Ingot"); ModLoader.addSmelting(LightOre.blockID, new ItemStack ( LightIngot, 1), 0.1F); //Light Ingot// //Lightdirt// Lightdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/lightdirt.png"); ModLoader.registerBlock(Lightdirt); ModLoader.addName(Lightdirt, "Lightdirt"); ModLoader.addRecipe(new ItemStack(Lightdirt, 2), new Object [] {"###", "#$#", "###", Character.valueOf('#'), Block.dirt, Character.valueOf('$'), LightIngot}); //Lightdirt// //Lightonium Ore// LightOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/lightore.png"); ModLoader.registerBlock(LightOre); ModLoader.addName(LightOre, "Lightonium Ore"); //Lightonium Ore// } //Lightonium Ore// public void generateSurface (World world, Random random, int chunkX, int chunkZ) { for (int i=0; i < 2; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(LightOre.blockID, 10)).generate (world, random, randPosX, randPosY, randPosZ); } } public String getVersion() { return "1.3.2"; } }Error:
I thought the damage factor is in your arrow class :DHey would the Forge TUTs come after all of the things on ur list?
U'd have to use more than one texture I think
Thanks
-TheDataMiner
Can anybody help?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffBy using Forge, or using the ModLoader tutorials that are still going to be there.
Or use Forge.
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Diego Granada\Desktop\mcp72\jars\.\crash-reports\crash-2012-08-24_21.23.47-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 84f2ee --------
Generated 8/24/12 9:23 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 994663456 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 3
ModLoader 1.3.2
mod_ApplePieNathan 1.3.2
mod_BrownieJoaco 1.3.2
java.lang.RuntimeException: Invalid shapeless recipy!
at net.minecraft.src.CraftingManager.addShapelessRecipe(CraftingManager.java:222)
at net.minecraft.src.ModLoader.addShapelessRecipe(ModLoader.java:512)
at net.minecraft.src.mod_BrownieJoaco.load(mod_BrownieJoaco.java:10)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b8e807d9 ----------
And this is my code
package net.minecraft.src; public class mod_BrownieJoaco extends BaseMod { public static final Item brownie = new ItemFood(5002, 6, 5F, false).setItemName("anybrownie"); public void load() { brownie.iconIndex = ModLoader.addOverride("/gui/items.png", "/brownie.png"); ModLoader.addName(brownie, "Brownie con leche"); ModLoader.addShapelessRecipe(new ItemStack(brownie, 1), new Object[] {Item.sugar, Item.bucketMilk, Item.egg, Item.dyePowder, 1, 3}); }public String getVersion() { return "1.3.2"; } }I think its cause you have to many commas....
Win
it should just pull the right texture from the path the mod_ file specifies. Then it just projects the texture in the shape the blockmod file specifies.
Find this line in your bow class: EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F); and edit 2.0F to anything you like. Higher means more damage.
Code:
Tried 2 differemt things:
package net.minecraft.src; import java.util.Random; public class mod_LotsofStuff extends BaseMod { public static final Item DiamondNugget = new Item(3000).setItemName("DiamondNugget"); public static final Item Chocolate = new ItemFood(3001, 4, 1F, false).setItemName("Chocolate"); public static final Block JungleBook = new BlockJungleBook(171, 0).setBlockName("JungleBook").setHardness(1.5F).setCreativeTab(CreativeTabs.tabBlock); public static int JungleBookBottom = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBbottom.png"); public static int JungleBookTop = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBtop.png"); public static int JungleBookSides = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBsides.png"); public void load() { ModLoader.registerBlock(JungleBook); ModLoader.addName(DiamondNugget, "Diamond Nugget"); ModLoader.addName(Chocolate, "Chocolate"); ModLoader.addName(JungleBook, "Jungle BookShelf"); ModLoader.addOverride("/gui/items.png", "LotsofStuff/Chocolate.png"); ModLoader.addOverride("/gui/items.png", "LotsofStuff/DiamondNugget.png"); ModLoader.addRecipe(new ItemStack(JungleBook, 1), new Object [] {"###", "$$$", "###", Character.valueOf('$'), Item.book, Character.valueOf('#'), Block.planks, 3}); } public String getVersion() { return "1.3.1"; } }And:
package net.minecraft.src; import java.util.Random; public class mod_LotsofStuff extends BaseMod { public static final Item DiamondNugget = new Item(3000).setItemName("DiamondNugget"); public static final Item Chocolate = new ItemFood(3001, 4, 1F, false).setItemName("Chocolate"); public static final Block JungleBook = new BlockJungleBook(171, 0).setBlockName("JungleBook").setHardness(1.5F).setCreativeTab(CreativeTabs.tabBlock); public static int JungleBookBottom = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBbottom.png"); public static int JungleBookTop = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBtop.png"); public static int JungleBookSides = ModLoader.addOverride("/terrain.png", "LotsofStuff/JBsides.png"); public void load() { ModLoader.registerBlock(JungleBook); ModLoader.addName(DiamondNugget, "Diamond Nugget"); ModLoader.addName(Chocolate, "Chocolate"); ModLoader.addName(JungleBook, "Jungle BookShelf"); ModLoader.addOverride("/gui/items.png", "LotsofStuff/Chocolate.png"); ModLoader.addOverride("/gui/items.png", "LotsofStuff/DiamondNugget.png"); ModLoader.addRecipe(new ItemStack(JungleBook, 1), new Object [] {"###", "$$$", "###", Character.valueOf('$'), Item.book, Character.valueOf('#'), Block.planks, 1, 3}); } public String getVersion() { return "1.3.1"; } }I figured it out; instead of setCreativeTab( ) you use setTabToDisplayOn( ). You might want to include that in your tutorial, as it is something fairly basic that most mod developers need to know.
Thanks!
But when i test it with my recipe it makes a normal bookshelf instead of my Jungle BookShelf