Thank you for the modding tutorials! They really help me! Hey, how do we turn the coding into the class files and folders for when we are done modding?
Thank you for the modding tutorials! They really help me! Hey, how do we turn the coding into the class files and folders for when we are done modding?
Thank you for the modding tutorials! They really help me! Hey, how do we turn the coding into the class files and folders for when we are done modding?
These are all your modded files, encrypted and ready to be put inside Minecraft.jar
I suggest that you include the java files from ModLoader, when you zip the whole thing. That way people can just download ur mod, and drop it inside minecraft - all ready to use.
Also, you need to put any new textures in the zip file too. In their respective directories ofcourse.
If we are adding a block and an item, do we do them in the same mod_*** file? And if our mod has multiple items and blocks, do they also get put in the same mod_*** file? P.S. Sorry for my earlier reply being posted twice.
ModLoader.addSmelting(yourBlock.blockID, new ItemStack(yourSmeltedBlock, 1), 1.0F);
Adding smelting recipes for blocks is almost identical to adding smelting recipes for items. The only thing that changes is the first parameter:
yourBlock.blockID, this parameter has to be an integer, so we would use .blockID to find the block ID of our block. This is the only difference between items and blocks. Put the name of your item you want to input into your furnace where it says yourBlock.
new ItemStack(yourSmeltedBlock, 1), this parameter takes a new instance of the class ItemStack, which takes two more parameters: yourSmeltedBlock which is what the furnace will output once the input is smelted, and 1, this number is the amount you will get of the output once it is smelted. Even though this references the class ItemStack, this still works for Blocks!
1.0F, the last parameter is a float, which means that it can be a decimal number. This is how much XP you will receive after each successful smelt.
This should do it for the adding new smelting recipes tutorial! Ask any questions below, or tell me what to add to this tutorial.
Ok so this is my code
ModLoader.addSmelting(mod_ores.sarliteore.blockID, new ItemStack(mod_ores.sarliteingot, 1), 100.0F);
Why 100? Well because it still adds just 1 of the little sections of the experience bar! Why does this happens?? Help!
I seem to get an error when I use the achievement code saying that it "Cannot reference a field before it is defined" on the acquireIron part below. This is when I try to make my achievement work off of an achievement in vanilla. Any suggestions?
Hey all, sorry if these questions have already been asked but I'm too lazy to look thru the thread...
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
2. How can I make a custom potion effect? Right now I've created a new PotionRadiation.java (it's supposed to be a radiation damage effect):
public class PotionRadiation extends Potion
{
protected PotionRadiation(int par1, boolean par2, int par3) {
super(par1, par2, par3);
}
public void performEffect(EntityLiving par1EntityLiving, int par2)
{
par1EntityLiving.attackEntityFrom(DamageSource.magic, 1);
}
}
So this works mostly... when I'm affected potion particles appear around me and an icon appears next to my inventory. However, I'm not taking any damage from the potion, and that's the only thing that seems to not work.
Any help would be much appreciated! Thanks in advance
Hey all, sorry if these questions have already been asked but I'm too lazy to look thru the thread...
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
2. How can I make a custom potion effect? Right now I've created a new PotionRadiation.java (it's supposed to be a radiation damage effect):
public class PotionRadiation extends Potion
{
protected PotionRadiation(int par1, boolean par2, int par3) {
super(par1, par2, par3);
}
public void performEffect(EntityLiving par1EntityLiving, int par2)
{
par1EntityLiving.attackEntityFrom(DamageSource.magic, 1);
}
}
So this works mostly... when I'm affected potion particles appear around me and an icon appears next to my inventory. However, I'm not taking any damage from the potion, and that's the only thing that seems to not work.
Any help would be much appreciated! Thanks in advance
Jerry
I would recommend just adding the flammable thing directly in. Unless you plan using any other mods with yours.
Hi, I have a few problems with my mod.
Here is the code:
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_MemeCraft extends BaseMod
{
public static final Block oreTroll = new BlockTrollBlock(151, 0).setStepSound(Block.soundStoneFootstep).setBlockName("oreWolfestone").setHardness(4.5F).setResistance(5F).setLightValue(0.375F);
public void load()
{
oreTroll.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Troll Block.png");
ModLoader.registerBlock(oreTroll);
ModLoader.addName(oreTroll, "Troll Block");
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 600; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(oreTroll.blockID, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.4.6";
}
}
This mod adds Meme related stuff to Minecraft.
The problem is... ModLoader, for some reason is underlined in red, along with BaseMod. Also, if i just put Block instead of BlockTrollBlock, then there will still be an error!(But I fixed that by making a Class for BlockTrollBlock, I just need an explanation of why that was happening.)
Other Class code:
BlockTrollBlock:
package net.minecraft.src;
import java.util.Random;
public class BlockTrollBlock extends Block
{
public BlockTrollBlock(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_MemeCraft.Trolls.shiftedIndex;
}
}
The Trolls will be underlined because I have not made them. I hope you will be able to help me, you seem to be an awesome intelligent modder! Thank you, and have a Happy New Year!!!
I'm having trouble with my mod, when I generate and install it and I go and mine with my tools the block that I mine doesn't drop anything. I'm not sure whats wrong, can you take a look? If you can help me please reply, I do not know why it's not working, I think I did everything right.
Note: It worked when I tested it in the eclipse Minecraft client, but not in my actual Minecraft.
mod_MoreTools
package net.minecraft.src;
import java.util.Random;
public class mod_MoreTools extends BaseMod
{
//Register items here.
public static final Item BoneSword = new ItemSword(5000, EnumToolMaterial.BONE).setItemName("Bone Sword");
public static final Item BonePickaxe = new ItemPickaxe(5001, EnumToolMaterial.BONE).setItemName("Bone Pickaxe");
public static final Item BoneSpade = new ItemSpade(5002, EnumToolMaterial.BONE).setItemName("Bone Shovel");
public static final Item BoneAxe = new ItemAxe(5003, EnumToolMaterial.BONE).setItemName("Bone Axe");
public static final Item BoneHoe = new ItemHoe(5004, EnumToolMaterial.BONE).setItemName("Bone Hoe");
public static final Item BlazeSword = new ItemBlazeSword(5005, EnumToolMaterial.BLAZE).setItemName("Blaze Sword");
public static final Item BlazePickaxe = new ItemPickaxe(5006, EnumToolMaterial.BLAZE).setItemName("Blaze Pickaxe");
public static final Item BlazeSpade = new ItemSpade(5007, EnumToolMaterial.BLAZE).setItemName("Blaze Shovel");
public static final Item BlazeAxe = new ItemAxe(5008, EnumToolMaterial.BLAZE).setItemName("Blaze Axe");
public static final Item BlazeHoe = new ItemHoe(5009, EnumToolMaterial.BLAZE).setItemName("Blaze Hoe");
public static final Item EmeraldSword = new ItemSword(5010, EnumToolMaterial.GREEN).setItemName("Emerald Sword");
public static final Item EmeraldPickaxe = new ItemPickaxe(5011, EnumToolMaterial.GREEN).setItemName("Emerald Pickaxe");
public static final Item EmeraldSpade = new ItemSpade(5012, EnumToolMaterial.GREEN).setItemName("Emerald Shovel");
public static final Item EmeraldAxe = new ItemAxe(5013, EnumToolMaterial.GREEN).setItemName("Emerald Axe");
public static final Item EmeraldHoe = new ItemHoe(5014, EnumToolMaterial.GREEN).setItemName("Emerald Hoe");
public static final Item NetherrackSword = new ItemNetherrackSword(5015, EnumToolMaterial.RACK).setItemName("Netherrack Sword");
public static final Item NetherrackPickaxe = new ItemPickaxe(5016, EnumToolMaterial.RACK).setItemName("Netherrack Pickaxe");
public static final Item NetherrackSpade = new ItemSpade(5017, EnumToolMaterial.RACK).setItemName("Netherrack Shovel");
public static final Item NetherrackAxe = new ItemAxe(5018, EnumToolMaterial.RACK).setItemName("Netherrack Axe");
public static final Item NetherrackHoe = new ItemHoe(5019, EnumToolMaterial.RACK).setItemName("Netherrack Hoe");
public void load()
{
//Register items into mod loader here.
BoneSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneSword.png");
ModLoader.addName(BoneSword, "Bone Sword");
ModLoader.addRecipe(new ItemStack(BoneSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Item.bone
});
BonePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBonePickaxe.png");
ModLoader.addName(BonePickaxe, "Bone Pickaxe");
ModLoader.addRecipe(new ItemStack(BonePickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Item.bone
});
BoneSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneShovel.png");
ModLoader.addName(BoneSpade, "Bone Shovel");
ModLoader.addRecipe(new ItemStack(BoneSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Item.bone
});
BoneAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneAxe.png");
ModLoader.addName(BoneAxe, "Bone Axe");
ModLoader.addRecipe(new ItemStack(BoneAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Item.bone
});
BoneHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBoneHoe.png");
ModLoader.addName(BoneHoe, "Bone Hoe");
ModLoader.addRecipe(new ItemStack(BoneHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Item.bone
});
BlazeSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeSword.png");
ModLoader.addName(BlazeSword, "Blaze Sword");
ModLoader.addRecipe(new ItemStack(BlazeSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazePickaxe.png");
ModLoader.addName(BlazePickaxe, "Blaze Pickaxe");
ModLoader.addRecipe(new ItemStack(BlazePickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazeSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeShovel.png");
ModLoader.addName(BlazeSpade, "Blaze Shovel");
ModLoader.addRecipe(new ItemStack(BlazeSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazeAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeAxe.png");
ModLoader.addName(BlazeAxe, "Blaze Axe");
ModLoader.addRecipe(new ItemStack(BlazeAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
BlazeHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemBlazeHoe.png");
ModLoader.addName(BlazeHoe, "Blaze Hoe");
ModLoader.addRecipe(new ItemStack(BlazeHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Item.blazeRod
});
EmeraldSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldSword.png");
ModLoader.addName(EmeraldSword, "Emerald Sword");
ModLoader.addRecipe(new ItemStack(EmeraldSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldPickaxe.png");
ModLoader.addName(EmeraldPickaxe, "Emerald Pickaxe");
ModLoader.addRecipe(new ItemStack(EmeraldPickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldShovel.png");
ModLoader.addName(EmeraldSpade, "Emerald Shovel");
ModLoader.addRecipe(new ItemStack(EmeraldSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldAxe.png");
ModLoader.addName(EmeraldAxe, "Emerald Axe");
ModLoader.addRecipe(new ItemStack(EmeraldAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Item.emerald
});
EmeraldHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemEmeraldHoe.png");
ModLoader.addName(EmeraldHoe, "Emerald Hoe");
ModLoader.addRecipe(new ItemStack(EmeraldHoe, 1), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Item.emerald
});
NetherrackSword.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackSword.png");
ModLoader.addName(NetherrackSword, "Netherrack Sword");
ModLoader.addRecipe(new ItemStack(NetherrackSword, 1), new Object[]
{
" * ", " * ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackPickaxe.png");
ModLoader.addName(NetherrackPickaxe, "Netherrack Pickaxe");
ModLoader.addRecipe(new ItemStack(NetherrackPickaxe, 1), new Object[]
{
"***", " X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackSpade.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackShovel.png");
ModLoader.addName(NetherrackSpade, "Netherrack Shovel");
ModLoader.addRecipe(new ItemStack(NetherrackSpade, 1), new Object[]
{
" * ", " X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackAxe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackAxe.png");
ModLoader.addName(NetherrackAxe, "Netherrack Axe");
ModLoader.addRecipe(new ItemStack(NetherrackAxe, 1), new Object[]
{
"** ", "*X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
NetherrackHoe.iconIndex = ModLoader.addOverride("/gui/items.png" , "/MoreTools/ItemNetherrackHoe.png");
ModLoader.addName(NetherrackHoe, "Netherrack Hoe");
ModLoader.addRecipe(new ItemStack(NetherrackHoe), new Object[]
{
"** ", " X ", " X ",
'X', Item.stick, '*', Block.netherrack
});
//Add items to inventory here.
BoneSword.setCreativeTab(CreativeTabs.tabCombat);
BonePickaxe.setCreativeTab(CreativeTabs.tabTools);
BoneSpade.setCreativeTab(CreativeTabs.tabTools);
BoneAxe.setCreativeTab(CreativeTabs.tabTools);
BoneHoe.setCreativeTab(CreativeTabs.tabTools);
BlazeSword.setCreativeTab(CreativeTabs.tabCombat);
BlazePickaxe.setCreativeTab(CreativeTabs.tabTools);
BlazeSpade.setCreativeTab(CreativeTabs.tabTools);
BlazeAxe.setCreativeTab(CreativeTabs.tabTools);
BlazeHoe.setCreativeTab(CreativeTabs.tabTools);
EmeraldSword.setCreativeTab(CreativeTabs.tabCombat);
EmeraldPickaxe.setCreativeTab(CreativeTabs.tabTools);
EmeraldSpade.setCreativeTab(CreativeTabs.tabTools);
EmeraldAxe.setCreativeTab(CreativeTabs.tabTools);
EmeraldHoe.setCreativeTab(CreativeTabs.tabTools);
NetherrackSword.setCreativeTab(CreativeTabs.tabCombat);
NetherrackPickaxe.setCreativeTab(CreativeTabs.tabTools);
NetherrackSpade.setCreativeTab(CreativeTabs.tabTools);
NetherrackAxe.setCreativeTab(CreativeTabs.tabTools);
NetherrackHoe.setCreativeTab(CreativeTabs.tabTools);
}
public String getVersion()
{
//Make sure to return the correct version.
return "MoreTools v.0.01";
}
}
//A Blokster Studios Creation. Do not steal!
ItemBlazeSword
package net.minecraft.src;
public class ItemBlazeSword extends ItemSword {
public ItemBlazeSword(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
}
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{
entityliving.setFire(20);
return true;
}
public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
public String getItemDisplayName(ItemStack par1ItemStack){
String var2 = ("\u00a74" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim();
return var2;
}
}
ItemNetherrackSword
package net.minecraft.src;
public class ItemNetherrackSword extends ItemSword {
public ItemNetherrackSword(int par1, EnumToolMaterial par2EnumToolMaterial) {
super(par1, par2EnumToolMaterial);
}
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{
entityliving.setFire(10);
return true;
}
public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
public String getItemDisplayName(ItemStack par1ItemStack){
String var2 = ("\u00a74" + StringTranslate.getInstance().translateNamedKey(this.getLocalItemName(par1ItemStack))).trim();
return var2;
}
}
EnumToolMaterial
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),
BONE(1, 85, 3.0F, 1, 15),
BLAZE(2, 450, 5.0F, 2, 5),
GREEN(3, 2561, 8.0F, 3, 22),
RACK(1, 100, 6.0F, 1, 5);
/**
* 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))));
}
}
The Meaning of Life, the Universe, and Everything.
Join Date:
1/12/2012
Posts:
255
Member Details
I have a problem with my biome "Savanna" that I create, I find it anywhere and it makes the game crash
Here are my codes:
package anaghold.wondercraft.common;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;@Mod(modid = "WC", name = "Wondercraft", version = "pre-alpha")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Wondercraft
{
@SidedProxy(clientSide = "anaghold.wondercraft.client.ClientProxy", serverSide = "anaghold.wondercraft.common.CommonProxy")
public static CommonProxy proxy;
//BLOCK
public static Block oreCopper;
public static Block blockCopper;
public static Block blockCopperOxidized;
public static Block grateIron;
public static Block chainIron;
public static Block laterite;
//ITEMS
public static Item ingotCopper;
//BIOME
public static BiomeGenBase savanna;
@PreInit
public void initConfig(FMLPreInitializationEvent fpe)
{
}
@Init
public void load(FMLInitializationEvent event)
{
proxy.registerRenderThings();
//BLOCK
oreCopper = new BlockOreCopper(2500, 0).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setBlockName("oreCopper");
blockCopper = new BlockCopper(2501, 1).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setBlockName("blockCopper");
blockCopperOxidized = new BlockCopperOxidized(2502, 2).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setBlockName("blockCopperOxidized");
grateIron = new BlockGrate(2503, 3).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setBlockName("grateIron");
chainIron = new BlockChain(2504, 4).setStepSound(Block.soundMetalFootstep).setBlockName("chainIron");
laterite = new BlockLaterite(2505, 16).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setBlockName("laterite");
//ITEMS
ingotCopper = new ItemIngotCopper(20150).setIconIndex(0).setItemName("ingotCopper");
//BIOME
savanna = new BiomeGenSavanna(145).setColor(16421912).setBiomeName("savanna").setTemperatureRainfall(2.0F, 0.0F);
//REGISTER
GameRegistry.registerBlock(oreCopper,"Copper Ore");
GameRegistry.registerBlock(blockCopper,"Block of Copper");
GameRegistry.registerBlock(blockCopperOxidized,"Block of Copper Oxidized");
GameRegistry.registerBlock(grateIron,"Grate");
GameRegistry.registerBlock(chainIron,"Chain");
GameRegistry.registerBlock(laterite,"Laterite");
GameRegistry.registerWorldGenerator(new WorldGenOre());
GameRegistry.addBiome(savanna);
//RECIPE
GameRegistry.addRecipe(new ItemStack(blockCopper), new Object[] {"###", "###", "###", '#', ingotCopper});
GameRegistry.addRecipe(new ItemStack(grateIron), new Object[] {"##", "##", '#', Block.fenceIron});
GameRegistry.addRecipe(new ItemStack(chainIron, 4), new Object[] {"#", "#", '#', Item.ingotIron});
GameRegistry.addSmelting(oreCopper.blockID, new ItemStack(ingotCopper, 1), 0.7F);
//HARVEST
MinecraftForge.setBlockHarvestLevel(oreCopper, "pickaxe", 1);
//NAME IN GAME
LanguageRegistry.addName(oreCopper, "Copper Ore");
LanguageRegistry.addName(ingotCopper, "Copper Ingot");
LanguageRegistry.addName(blockCopper, "Block of Copper");
LanguageRegistry.addName(blockCopperOxidized, "Block of Copper Oxidized");
LanguageRegistry.addName(grateIron, "Grate");
LanguageRegistry.addName(chainIron, "Chain");
LanguageRegistry.addName(laterite, "Laterite");
}
}
package anaghold.wondercraft.common;
import java.util.Random;import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
public class BiomeGenSavanna extends BiomeGenBase
{
public BiomeGenSavanna(int par1)
{
super(par1);
this.spawnableCreatureList.clear();
this.topBlock = (byte)Wondercraft.laterite.blockID;
this.fillerBlock = (byte)Wondercraft.laterite.blockID;
this.minHeight = -0.4F;
this.maxHeight = 0.54F;
}
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
}
}
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!
Time: 02/01/13 22:50
Description: Exception getting block type in worldjava.lang.NullPointerException
at net.minecraft.world.World.getTopSolidOrLiquidBlock(World.java:1967)
at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:226)
at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:203)
at net.minecraft.world.biome.BiomeGenBase.decorate(BiomeGenBase.java:366)
at anaghold.wondercraft.common.BiomeGenSavanna.decorate(BiomeGenSavanna.java:22)
at net.minecraft.world.gen.ChunkProviderGenerate.populate(ChunkProviderGenerate.java:577)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:258)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1248)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:166)
at net.minecraft.world.World.getChunkFromChunkCoords(World.java:521)
at net.minecraft.world.World.getBlockId(World.java:404)
at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:70)
at anaghold.wondercraft.common.WorldGenOre.generateSurface(WorldGenOre.java:23)
at anaghold.wondercraft.common.WorldGenOre.generate(WorldGenOre.java:17)
at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:90)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1248)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:166)
at net.minecraft.world.World.getChunkFromChunkCoords(World.java:521)
at net.minecraft.world.World.getBlockId(World.java:404)
at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:70)
at anaghold.wondercraft.common.WorldGenOre.generateSurface(WorldGenOre.java:23)
at anaghold.wondercraft.common.WorldGenOre.generate(WorldGenOre.java:17)
at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:90)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1258)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.server.management.PlayerInstance.<init>(PlayerInstance.java:35)
at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:89)
at net.minecraft.server.management.PlayerManager.updateMountedMovingPlayer(PlayerManager.java:248)
at net.minecraft.server.management.ServerConfigurationManager.serverUpdateMountedMovingPlayer(ServerConfigurationManager.java:220)
at net.minecraft.network.NetServerHandler.handleFlying(NetServerHandler.java:410)
at net.minecraft.network.packet.Packet10Flying.processPacket(Packet10Flying.java:51)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:599)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
----------------------------------------------------------------------------------------- Head --
Stacktrace:
at net.minecraft.world.World.getTopSolidOrLiquidBlock(World.java:1967)
at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:226)
at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:203)
at net.minecraft.world.biome.BiomeGenBase.decorate(BiomeGenBase.java:366)
at anaghold.wondercraft.common.BiomeGenSavanna.decorate(BiomeGenSavanna.java:22)
at net.minecraft.world.gen.ChunkProviderGenerate.populate(ChunkProviderGenerate.java:577)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:258)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1248)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:166)
at net.minecraft.world.World.getChunkFromChunkCoords(World.java:521)
-- Requested block coordinates --
Details:
Found chunk: true
Location: World: (125,60,673), Chunk: (at 13,3,1 in 7,42; contains blocks 112,0,672 to 127,255,687), Region: (0,1; contains chunks 0,32 to 31,63, blocks 0,0,512 to 511,255,1023)
Stacktrace:
at net.minecraft.world.World.getBlockId(World.java:404)
at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:70)
at anaghold.wondercraft.common.WorldGenOre.generateSurface(WorldGenOre.java:23)
at anaghold.wondercraft.common.WorldGenOre.generate(WorldGenOre.java:17)
at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:90)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1248)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:166)
at net.minecraft.world.World.getChunkFromChunkCoords(World.java:521)-- Requested block coordinates --
Details:
Found chunk: true
Location: World: (99,42,671), Chunk: (at 3,2,15 in 6,41; contains blocks 96,0,656 to 111,255,671), Region: (0,1; contains chunks 0,32 to 31,63, blocks 0,0,512 to 511,255,1023)
Stacktrace:
at net.minecraft.world.World.getBlockId(World.java:404)
at net.minecraft.world.gen.feature.WorldGenMinable.generate(WorldGenMinable.java:70)
at anaghold.wondercraft.common.WorldGenOre.generateSurface(WorldGenOre.java:23)
at anaghold.wondercraft.common.WorldGenOre.generate(WorldGenOre.java:17)
at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:90)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1258)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.server.management.PlayerInstance.<init>(PlayerInstance.java:35)
at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:89)
at net.minecraft.server.management.PlayerManager.updateMountedMovingPlayer(PlayerManager.java:248)
at net.minecraft.server.management.ServerConfigurationManager.serverUpdateMountedMovingPlayer(ServerConfigurationManager.java:220)
at net.minecraft.network.NetServerHandler.handleFlying(NetServerHandler.java:410)
at net.minecraft.network.packet.Packet10Flying.processPacket(Packet10Flying.java:51)
at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:80)
at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:136)
at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:57)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:108)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:599)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:123)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:497)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
-- System Details --
Details:
Minecraft Version: 1.4.7
Operating System: Windows 7 (x86) version 6.1
Java Version: 1.7.0_10, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 773387648 bytes (737 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 7218 (404208 bytes; 0 MB) allocated, 2713 (151928 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v7.26 FML v4.7.4.520 Minecraft Forge 6.6.0.497 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
WC [Wondercraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1427 (79912 bytes; 0 MB) allocated, 1268 (71008 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player336'/136, l='New World', x=-67,15, y=66,22, z=512,33]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'forge,fml'
Hey all, sorry if these questions have already been asked but I'm too lazy to look thru the thread...
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
2. How can I make a custom potion effect? Right now I've created a new PotionRadiation.java (it's supposed to be a radiation damage effect):
public class PotionRadiation extends Potion
{
protected PotionRadiation(int par1, boolean par2, int par3) {
super(par1, par2, par3);
}
public void performEffect(EntityLiving par1EntityLiving, int par2)
{
par1EntityLiving.attackEntityFrom(DamageSource.magic, 1);
}
}
So this works mostly... when I'm affected potion particles appear around me and an icon appears next to my inventory. However, I'm not taking any damage from the potion, and that's the only thing that seems to not work.
Any help would be much appreciated! Thanks in advance
Jerry
Are you playing in creative...? And also I don't think potionRadiation is an effect. Try potionWither.
Rollback Post to RevisionRollBack
I fought through the Nether and all I got was this stupid signature.
Could you guys please put your Codes in Spoilers?!
Hey buddy, Did you try working with forge? I've been on break for the holidays so I was slacking in my coding. :] I haven't had time to mess with forge. Also, could you pm me how to put my pmc as my sig?
Rollback Post to RevisionRollBack
I fought through the Nether and all I got was this stupid signature.
Hi, I'm back, sorry I couldn't say Thanks but I got really busy and wasn't able to. :/ Anyway, I'm back, and I have a slight question. I added my armor name to RenderPlayer and put the texture I designed in the armor folder but I have a tiny problem: How do I make it so that the "blueStone" in RenderPlayer actually knows to attach the texture to my armor? 'cause It's still looking like a white blob. If you can help, please do.
public static final Item blueHelmet = new ItemArmor(5003,
EnumArmorMaterial.BLUE, ModLoader.addArmor("myhead"), 0)
.setItemName("blueHelmet");
public static final Item blueChestplate = new ItemArmor(5004,
EnumArmorMaterial.BLUE, ModLoader.addArmor("mychest"), 1)
.setItemName("blueChestplate");
public static final Item blueLeggings = new ItemArmor(5005,
EnumArmorMaterial.BLUE, ModLoader.addArmor("mylegs"), 2)
.setItemName("blueLeggings");
public static final Item blueBoots = new ItemArmor(5006,
EnumArmorMaterial.BLUE, ModLoader.addArmor("myfeet"), 3)
.setItemName("blueBoots");
Hi, I'm back, sorry I couldn't say Thanks but I got really busy and wasn't able to. :/ Anyway, I'm back, and I have a slight question. I added my armor name to RenderPlayer and put the texture I designed in the armor folder but I have a tiny problem: How do I make it so that the "blueStone" in RenderPlayer actually knows to attach the texture to my armor? 'cause It's still looking like a white blob. If you can help, please do.
public static final Item blueHelmet = new ItemArmor(5003,
EnumArmorMaterial.BLUE, ModLoader.addArmor("myhead"), 0)
.setItemName("blueHelmet");
public static final Item blueChestplate = new ItemArmor(5004,
EnumArmorMaterial.BLUE, ModLoader.addArmor("mychest"), 1)
.setItemName("blueChestplate");
public static final Item blueLeggings = new ItemArmor(5005,
EnumArmorMaterial.BLUE, ModLoader.addArmor("mylegs"), 2)
.setItemName("blueLeggings");
public static final Item blueBoots = new ItemArmor(5006,
EnumArmorMaterial.BLUE, ModLoader.addArmor("myfeet"), 3)
.setItemName("blueBoots");
If in the RenderPlayer file the name of the armour is "blue" then name your armor "blue_1" and "blue_2" like how armour is in a texture pack. Also, put a folder called "armor" in your bin folder so that it recognizes it.
Rollback Post to RevisionRollBack
I fought through the Nether and all I got was this stupid signature.
I want to play around with modding in ModLoader, but I can't get the 'spoilers' to show anything on the first page where the tutorials are located... The only one that opens is the first one that explains how to install the programming environment, and all of the others show nothing. When I click 'show', the button's dialog turns to 'hide' but nothing appears. Can anyone help me on this? Thanks!
Thank you, I only have two questions: 1. Is it with RenderPlayer that capitals are not accepted? 2. Do you mean the armor folder in the bin folder, or the armor folder in the .jar. 3. How do I tell RenderPlayer "*blank* Render goes with *blank* ItemArmor"?
Same.
The one beneath is how.
Ok so this is my code
Why 100? Well because it still adds just 1 of the little sections of the experience bar! Why does this happens?? Help!
Visit my youtube channel? http://www.youtube.com/user/TheCoolgatty
public static final Achievement myAchievement = new Achievement(5003, "AchievementName", 13, -2, MyItem, acquireIron).registerAchievement();
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
so I try to add my own code:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
2. How can I make a custom potion effect? Right now I've created a new PotionRadiation.java (it's supposed to be a radiation damage effect):
So this works mostly... when I'm affected potion particles appear around me and an icon appears next to my inventory. However, I'm not taking any damage from the potion, and that's the only thing that seems to not work.
Any help would be much appreciated! Thanks in advance
Jerry
I would recommend just adding the flammable thing directly in. Unless you plan using any other mods with yours.
How would I do that? :S
EDIT: never mind! I fixed it.
Here is the code:
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_MemeCraft extends BaseMod
{
public static final Block oreTroll = new BlockTrollBlock(151, 0).setStepSound(Block.soundStoneFootstep).setBlockName("oreWolfestone").setHardness(4.5F).setResistance(5F).setLightValue(0.375F);
public void load()
{
oreTroll.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Troll Block.png");
ModLoader.registerBlock(oreTroll);
ModLoader.addName(oreTroll, "Troll Block");
}
public void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 600; k++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new WorldGenMinable(oreTroll.blockID, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.4.6";
}
}
This mod adds Meme related stuff to Minecraft.
The problem is... ModLoader, for some reason is underlined in red, along with BaseMod. Also, if i just put Block instead of BlockTrollBlock, then there will still be an error!(But I fixed that by making a Class for BlockTrollBlock, I just need an explanation of why that was happening.)
Other Class code:
BlockTrollBlock:
package net.minecraft.src;
import java.util.Random;
public class BlockTrollBlock extends Block
{
public BlockTrollBlock(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_MemeCraft.Trolls.shiftedIndex;
}
}
The Trolls will be underlined because I have not made them. I hope you will be able to help me, you seem to be an awesome intelligent modder! Thank you, and have a Happy New Year!!!
Note: It worked when I tested it in the eclipse Minecraft client, but not in my actual Minecraft.
mod_MoreTools
ItemBlazeSword
ItemNetherrackSword
EnumToolMaterial
Here are my codes:
Are you playing in creative...? And also I don't think potionRadiation is an effect. Try potionWither.
Hey buddy, Did you try working with forge? I've been on break for the holidays so I was slacking in my coding. :] I haven't had time to mess with forge. Also, could you pm me how to put my pmc as my sig?
public static final Item blueHelmet = new ItemArmor(5003,
EnumArmorMaterial.BLUE, ModLoader.addArmor("myhead"), 0)
.setItemName("blueHelmet");
public static final Item blueChestplate = new ItemArmor(5004,
EnumArmorMaterial.BLUE, ModLoader.addArmor("mychest"), 1)
.setItemName("blueChestplate");
public static final Item blueLeggings = new ItemArmor(5005,
EnumArmorMaterial.BLUE, ModLoader.addArmor("mylegs"), 2)
.setItemName("blueLeggings");
public static final Item blueBoots = new ItemArmor(5006,
EnumArmorMaterial.BLUE, ModLoader.addArmor("myfeet"), 3)
.setItemName("blueBoots");
{"cloth", "chain", "iron", "diamond", "gold", "blueStone"}
If in the RenderPlayer file the name of the armour is "blue" then name your armor "blue_1" and "blue_2" like how armour is in a texture pack. Also, put a folder called "armor" in your bin folder so that it recognizes it.