Hey, can you update the tools and ore generation section to 1.4.7?
Nope, sorry. Read the rant I just added to the top of the first OP.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I haven't tried to recompile my mod yet. I just need to change the codes for 1.4.7.
...you have to recompile it in order to get errors so you/we can fix it...
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.
Hey, can you update the tools and ore generation section to 1.4.7?
You know, you can just copy and paste from the minecraft source code. Look at Techguy's tutorial, see what file you want to update, and instead of using Techguy's code, use the original minecraft one. It works exactly the same pretty much.
I always get a syntax error on the [b]bolded text:[/b]
package net.minecraft.src;
public class mod_bluegem extends BaseMod
{
public static final Item Camera = new Item(3450).setItemName("Camera");
public static final Item BlueGem = new ItemBlueGem(3450).setItemName("bluegem").setCreativeTab(CreativeTabs.tabMaterials);
public static final Block BlockOfBlueGem = new BlockBlockOfBlueGem (140, 0).setBlockName("bluegemblock").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public void load()
{
BlueGem.iconIndex = ModLoader.addOverride("/gui/items.png", "/bluegem/bluegem.png");
ModLoader.addName(BlueGem, "Blue Gem");
ModLoader.addRecipe(new ItemStack(BlueGem, 64), new Object [] {"#", Character.valueOf('#'), Block.dirt});
BlockOfBlueGem.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/bluegem/bluegemblock.png");
ModLoader.registerBlock(BlockOfBlueGem);
ModLoader.addName(BlockOfBlueGem, "Block of Blue Gem");
ModLoader.addRecipe(new ItemStack(BlockOfBlueGem, 64), new Object [] {"###", "###", "###", Character.valueOf('#'), Block.stone});
}
public String getVersion()
{
return "1.4.7";
}
}
BlockBlockOfBlueGem[/b]']
package net.minecraft.src;
import java.util.Random;
public class BlockBlockOfBlueGem extends Block
{
public BlockBlockOfBlueGem(int i, int j)
{
super(i, j, Material.rock);
}
public int id3451(int i, Random random, int j)
{
return mod_bluegem.BlockOfBlueGem.[b]140[/b];
}
public int quantity1(Random random)
{
return 1;
}
}
What should I put in the blockID?
Block ID - 140?
or
Block ID - 3451?
I also don't what's the data value. Should I put 140?
Also, can you check if I got any mistakes.. Thanks!
I always get a syntax error on the [b]bolded text:[/b]
package net.minecraft.src;
public class mod_bluegem extends BaseMod
{
public static final Item Camera = new Item(3450).setItemName("Camera");
public static final Item BlueGem = new ItemBlueGem(3450).setItemName("bluegem").setCreativeTab(CreativeTabs.tabMaterials);
public static final Block BlockOfBlueGem = new BlockBlockOfBlueGem (140, 0).setBlockName("bluegemblock").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock).setStepSound(Block.soundStoneFootstep);
public void load()
{
BlueGem.iconIndex = ModLoader.addOverride("/gui/items.png", "/bluegem/bluegem.png");
ModLoader.addName(BlueGem, "Blue Gem");
ModLoader.addRecipe(new ItemStack(BlueGem, 64), new Object [] {"#", Character.valueOf('#'), Block.dirt});
BlockOfBlueGem.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/bluegem/bluegemblock.png");
ModLoader.registerBlock(BlockOfBlueGem);
ModLoader.addName(BlockOfBlueGem, "Block of Blue Gem");
ModLoader.addRecipe(new ItemStack(BlockOfBlueGem, 64), new Object [] {"###", "###", "###", Character.valueOf('#'), Block.stone});
}
public String getVersion()
{
return "1.4.7";
}
}
BlockBlockOfBlueGem[/b]']
package net.minecraft.src;
import java.util.Random;
public class BlockBlockOfBlueGem extends Block
{
public BlockBlockOfBlueGem(int i, int j)
{
super(i, j, Material.rock);
}
public int id3451(int i, Random random, int j)
{
return mod_bluegem.BlockOfBlueGem.[b]140[/b];
}
public int quantity1(Random random)
{
return 1;
}
}
What should I put in the blockID?
Block ID - 140?
or
Block ID - 3451?
I also don't what's the data value. Should I put 140?
Also, can you check if I got any mistakes.. Thanks!
You don't put an actual id there. You use blockID.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
public int idDropped(int i, Random random, int j)
{
return mod_bluegem.BlockOfBlueGem.blockID;
}
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Sorry to ask again, I really don't get the idea in the food.
Here:
(Potion.blindness.id, 10 * 20, 6)
1. 10 = 10 is what? I left it 10 because I really don't get the idea of that.
(Potion.blindness.id, 10 * 20, 6)
2. 20 = the seconds of the effect of the food? I wrote there 60 for 1 minute, is it right?
(Potion.blindness.id, 10 * 20, 6)
3. 6 = I wrote 0 there as what you've said because it's just an amplifier
The 10 is the amount of ticks it lasts for. You use 20 as a multiplier which makes the first to equal to that amount of seconds. Don't change the 20, only change the 10. 1 second is equal to 20 ticks. Eg.
(Potion.blindness.id, 10 * 20, 6)
Would last for 10 seconds.
(Potion.blindness.id, 5 * 20, 6)
Would last for 5 seconds.
(Potion.blindness.id, 14 * 20, 6)
Would last for 14 seconds. So on and etc.
I could never seem to get anything to change when I messed around with the amplifier.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
The 10 is the amount of ticks it lasts for. You use 20 as a multiplier which makes the first to equal to that amount of seconds. Don't change the 20, only change the 10. 1 second is equal to 20 ticks. Eg.
(Potion.blindness.id, 10 * 20, 6)
Would last for 10 seconds.
(Potion.blindness.id, 5 * 20, 6)
Would last for 5 seconds.
(Potion.blindness.id, 14 * 20, 6)
Would last for 14 seconds. So on and etc.
I could never seem to get anything to change when I messed around with the amplifier.
Alright, in the mod_class, in the line of the:
public static final Item Butter = new ItemButter(5010, 10, false),
when I add 1F as the food saturation, error happens. Do I need to add or not? Thanks again btw.
Alright, in the mod_class, in the line of the:
public static final Item Butter = new ItemButter(5010, 10, false),
when I add 1F as the food saturation, error happens. Do I need to add or not? Thanks again btw.
Remeber to always post the error you receive and the code that relates to it. On this occasion, the ItemButter class is required as well as the declaration which you have already posted.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Remeber to always post the error you receive and the code that relates to it. On this occasion, the ItemButter class is required as well as the declaration which you have already posted.
I was using the tool tutorial for modloader, And everything worked just as I wanted but when i try to mine obsidian is the same as if i tryed with my fist. What's wrong?
Obsidian.java
package net.minecraft.src;
public enum Obsidian
{
Obsidian(0, 59, 2.0F, 0, 15);
private final int harvestLevel;
private final int maxUses;
private final float efficiencyOnProperMaterial;
private final int damageVsEntity;
private final int enchantability;
private Obsidian(int par3, int par4, float par5, int par6, int par7)
{
harvestLevel = par3;
maxUses = par4;
efficiencyOnProperMaterial = par5;
damageVsEntity = par6;
enchantability = par7;
}
public int getMaxUses()
{
return 2000;
}
public float getEfficiencyOnProperMaterial()
{
return 25;
}
public int getDamageVsEntity()
{
return 5;
}
public int getHarvestLevel()
{
return 100;
}
public int getEnchantability()
{
return enchantability;
}
}
ObsidianTool.java
package net.minecraft.src;
public class ObsidianSword extends Item
{
private int weaponDamage;
private final Obsidian toolMaterial;
public ObsidianSword(int par1, Obsidian par2EnumToolMaterialNamehere)
{
super(par1);
toolMaterial = par2EnumToolMaterialNamehere;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialNamehere.getMaxUses());
weaponDamage = 4 + par2EnumToolMaterialNamehere.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return 10;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 0x11940;
}
/**
* 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)
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
}
ObsidianPickaxe.java
package net.minecraft.src;
public class ObsidianPickaxe extends ObsidianTool
{
private static Block[] blocksEffectiveAgainst = new Block[] {Block.obsidian, Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered};
protected ObsidianPickaxe(int par1, Obsidian par2Obsidian)
{
super(par1, 2, par2Obsidian, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
if (par1Block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 1;
}
if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block == Block.blockGold || par1Block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block == Block.blockSteel || par1Block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block == Block.blockLapis || par1Block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block.blockMaterial == Material.rock)
{
return true;
}
return par1Block.blockMaterial == Material.iron;
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))
{
return 25;
}
else
{
return super.getStrVsBlock(par1ItemStack, par2Block);
}
}
}
The mod works in minecraft but it cannot be eaten. The codes doesn't have any errors or breakpoints.
package net.minecraft.src;
public class mod_butter extends BaseMod
{
public static final Item Butter = new ItemButter(5010, 10, false).setItemName("butter").setCreativeTab(CreativeTabs.tabFood);
public void load()
{
Butter.iconIndex = ModLoader.addOverride("/gui/items.png", "/buttermod/butter.png");
ModLoader.addName(Butter, "Butter");
ModLoader.addShapelessRecipe(new ItemStack(Butter, 1), new Object [] {Item.sugar, Item.ingotGold, Item.bucketMilk});
}
public String getVersion()
{
return "1.4.7";
}
}
package net.minecraft.src;
public class ItemButter extends ItemFood
{
public ItemButter(int i, int j, boolean
{
super(i, j, B);
}
public ItemStack onFoodEaten(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
entityPlayer.getFoodStats().addStats(this);
world.playSoundAtEntity(entityPlayer, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
itemStack.stackSize--;
entityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60 * 20, 6));
entityPlayer.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 60 * 20, 6));
entityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 60 * 20, 6));
entityPlayer.addPotionEffect(new PotionEffect(Potion.jump.id, 60 * 20, 6));
return itemStack;
}
}
Help?!
i ran into this myself while following the tut and you have to change the number ten in the mod_ file where you do the public static stuff to a zero. no idea why but it worked for me
Nope, sorry. Read the rant I just added to the top of the first OP.
together they are powerful beyond imagination."
What error/s are you getting? I'll help you fix those but I won't update the tutorial.
together they are powerful beyond imagination."
...you have to recompile it in order to get errors so you/we can fix it...
You know, you can just copy and paste from the minecraft source code. Look at Techguy's tutorial, see what file you want to update, and instead of using Techguy's code, use the original minecraft one. It works exactly the same pretty much.
package net.minecraft.src;
import java.util.Random;
public class BlockBlockOfBlueGem extends Block
{
public BlockBlockOfBlueGem(int i, int j)
{
super(i, j, Material.rock);
}
public int id3451(int i, Random random, int j)
{
return mod_bluegem.BlockOfBlueGem.[b]140[/b];
}
public int quantity1(Random random)
{
return 1;
}
}
What should I put in the blockID?
Block ID - 140?
or
Block ID - 3451?
I also don't what's the data value. Should I put 140?
Also, can you check if I got any mistakes.. Thanks!
You don't put an actual id there. You use blockID.
together they are powerful beyond imagination."
together they are powerful beyond imagination."
Here:
(Potion.blindness.id, 10 * 20, 6)
1. 10 = 10 is what? I left it 10 because I really don't get the idea of that.
(Potion.blindness.id, 10 * 20, 6)
2. 20 = the seconds of the effect of the food? I wrote there 60 for 1 minute, is it right?
(Potion.blindness.id, 10 * 20, 6)
3. 6 = I wrote 0 there as what you've said because it's just an amplifier
The 10 is the amount of ticks it lasts for. You use 20 as a multiplier which makes the first to equal to that amount of seconds. Don't change the 20, only change the 10. 1 second is equal to 20 ticks. Eg.
Would last for 10 seconds.
Would last for 5 seconds.
Would last for 14 seconds. So on and etc.
I could never seem to get anything to change when I messed around with the amplifier.
together they are powerful beyond imagination."
public static final Item Butter = new ItemButter(5010, 10, false),
when I add 1F as the food saturation, error happens. Do I need to add or not? Thanks again btw.
Remeber to always post the error you receive and the code that relates to it. On this occasion, the ItemButter class is required as well as the declaration which you have already posted.
together they are powerful beyond imagination."
I'll try.
Help?!
Obsidian.java
i ran into this myself while following the tut and you have to change the number ten in the mod_ file where you do the public static stuff to a zero. no idea why but it worked for me