public class mod_Food extends BaseMod
{
public static final Item Deathberry = new ItemFood(437, 0, 0F, false).setPotionEffect(Potion.poison.id, 30, 15, 1F).setItemName("Deathberry");
public String getVersion()
{
return "1.5.1";
}
} [/spoiler]
Wolf, don't know if I did this right, but I tried! Tell me what's wrong and what I can improve. :3
To make a spoiler, do spoiler in these [] then your Words or Content lastly this = [/spoiler] make sure the Content is in between the spoilers
For some reason, after the 1.5 update, i cant seem to get the
Uhhh, is it okay for it to be modloader? cause thats what i use to code. and what models would you like? i can also make more blocks and items and mobs but you have to specify exactly what you want so i can code it to perfection
I can help to code this. Im pretty advanced in ModLoader and can make dimensions and new biomes and structures and all that good stuff. So, yea. I would love to help. Big fan of the warrior's series!
I have an error, when i try to make a new material...
Code (EnumToolMaterial.java)
package net.minecraft.src;
public enum EnumToolMaterial
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22);
PIRITA(3, 1000, 7.0F, 4, 15);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;
/** Damage versus entities. */
private final int damageVsEntity;
/** Defines the natural enchantability factor of the material. */
private final int enchantability;
private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}
/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
/**
* Return the crafting material for this tool material, used to determine the item that can be used to repair a tool
* with an anvil
*/
public int getToolCraftingMaterial()
{
return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0))));
}
}
Error in MCP:
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\EnumToolMaterial.java:10: error: invalid method
declaration; return type required
PIRITA(3, 1000, 7.0F, 4, 15);
^
src\minecraft\net\minecraft\src\EnumToolMaterial.java:10: error: illegal start o
f type
PIRITA(3, 1000, 7.0F, 4, 15);
^
src\minecraft\net\minecraft\src\EnumToolMaterial.java:10: error: illegal start o
f type
PIRITA(3, 1000, 7.0F, 4, 15);
^
src\minecraft\net\minecraft\src\EnumToolMaterial.java:10: error: illegal start o
f type
PIRITA(3, 1000, 7.0F, 4, 15);
^
src\minecraft\net\minecraft\src\EnumToolMaterial.java:10: error: illegal start o
f type
PIRITA(3, 1000, 7.0F, 4, 15);
^
src\minecraft\net\minecraft\src\EnumToolMaterial.java:10: error: illegal start o
f type
PIRITA(3, 1000, 7.0F, 4, 15);
^
6 errors
==================
!! Can not find server sources, try decompiling !!
Presione una tecla para continuar . . .
Here's the link for the mod(but i still dont know how to post pictures on the forum): http://www.mediafire.com/?it7t9e3aoene3zhDont forget that it requires modloader!
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_CromiteOre extends BaseMod
{
public static final Block CromiteOre = new BlockCromiteOre(160, 0).setStepSound(Block.soundStoneFootstep).setBlockName("CromiteOre").setHardness(4.5F).setResistance(5F).setLightValue(0.500F);
public void load()
{
CromiteOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/CromiteOre.png");
ModLoader.registerBlock(CromiteOre);
ModLoader.addName(CromiteOre, "Cromite Ore");
ModLoader.addSmelting(CromiteOre.blockID, new ItemStack(mod_CromiteIngot.CromiteIngot, 1), 1.0F);
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 8; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(CromiteOre.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.4.5";
}
}
The world generation code part starts at:
public void generateSurface(World world, Random random, int i, int j)
the simple parts you can change is the k < 8 part, which means how many veins can spawn per chunk (in this case eight), the part that says
int randPosY = random.nextInt(128);
which you can change the number (128) to whatever y leveel the ore is limited to (diamond is 16), and the part that says
(new WorldGenMinable(CromiteOre.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ);
which tells the function what, and how many of the block can spawn; in this case CromiteOre and it can spawn up to 8 per vein(its acually a liitle glitchy because i found a vein of 9, but its around that number).
BlockCromiteOre:
package net.minecraft.src;
import java.util.Random;
public class BlockCromiteOre extends Block
{
public BlockCromiteOre(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(int par1)
{
return (1);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_CromiteOre.CromiteOre.blockID;
}
}
mod_CromiteIngot:
package net.minecraft.src;
import java.util.Random;
public class mod_CromiteIngot extends BaseMod
{
public static final Item CromiteIngot = new Item(5000).setItemName("CromiteIngot");
public void load()
{
CromiteIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/CromiteIngot.png");
ModLoader.addName(CromiteIngot, "Cromite Ingot");
CromiteIngot.setCreativeTab(CreativeTabs.tabMaterials);
}
public String getVersion()
{
return "1.4.5";
}
}
I'll post pictures and the download link as soon as I can!
O, and If you want your own ingot texture, send me it; I'm just going to use my texture for my copper ingot mod
umm, how to I post pictures? (i'm new to the forum stuff xD)
0
0
For some reason, after the 1.5 update, i cant seem to get the or the functions to work.
0
0
0
0
0
0
0
0
On the part in the EnumToolMaterial
that says
you have two semicolons. change to
Hope that helps!
0
0
0
1
mod_CromiteOre
The world generation code part starts at: the simple parts you can change is the k < 8 part, which means how many veins can spawn per chunk (in this case eight), the part that says which you can change the number (128) to whatever y leveel the ore is limited to (diamond is 16), and the part that says which tells the function what, and how many of the block can spawn; in this case CromiteOre and it can spawn up to 8 per vein(its acually a liitle glitchy because i found a vein of 9, but its around that number).
O, and If you want your own ingot texture, send me it; I'm just going to use my texture for my copper ingot mod
umm, how to I post pictures? (i'm new to the forum stuff xD)
0