package net.minecraft.src;
import java.util.Map;
public class mod_MangMod extends BaseMod
{
public static final Item glasscup = new Item(5000).setItemName("glasscup");
public static final Item applejuice = new Item(5001).setItemName("applejuice");
public static final Item donut = new Item(5002).setItemName("donut");
public static final Item glazeddonut = new Item(5003).setItemName("glazeddonut");
public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(1F);
public static int aliengrassBottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png");
public static int aliengrassTop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png");
public static int aliengrassSides = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public void load()
{
ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
BiomeGenBase.plains,
BiomeGenBase.desert,
BiomeGenBase.desertHills,
BiomeGenBase.beach,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.forest,
BiomeGenBase.forestHills,
BiomeGenBase.taiga,
BiomeGenBase.taigaHills,
BiomeGenBase.swampland,
BiomeGenBase.river,
BiomeGenBase.jungle,
BiomeGenBase.jungleHills
});
glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png");
ModLoader.addName(glasscup, "Glass Cup");
ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Block.glass});
applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png");
ModLoader.addName(applejuice, "Apple Juice");
ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup});
donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png");
ModLoader.addName(donut, "Donut");
ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat});
glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png");
ModLoader.addName(glazeddonut, "Glazed Donut");
ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut});
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
ModLoader.registerBlock(aliengrass);
ModLoader.aliengrass(aliengrass, "Alien Grass");
ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt});
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
aliengrass.java
package net.minecraft.src;
public class aliengrass extends Block
{
public aliengrass(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_MangMod.aliengrassBottom;
}
if (i == 1)
{
return mod_MangMod.aliengrassTop;
}
else
{
return mod_MangMod.aliengrassSides;
}
}
}
package net.minecraft.src;
import java.util.Map;
public class mod_MangMod extends BaseMod
{
public static final Item glasscup = new Item(5000).setItemName("glasscup");
public static final Item applejuice = new Item(5001).setItemName("applejuice");
public static final Item donut = new Item(5002).setItemName("donut");
public static final Item glazeddonut = new Item(5003).setItemName("glazeddonut");
public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(1F);
public static int aliengrassBottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png");
public static int aliengrassTop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png");
public static int aliengrassSides = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public void load()
{
ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
BiomeGenBase.plains,
BiomeGenBase.desert,
BiomeGenBase.desertHills,
BiomeGenBase.beach,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.forest,
BiomeGenBase.forestHills,
BiomeGenBase.taiga,
BiomeGenBase.taigaHills,
BiomeGenBase.swampland,
BiomeGenBase.river,
BiomeGenBase.jungle,
BiomeGenBase.jungleHills
});
glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png");
ModLoader.addName(glasscup, "Glass Cup");
ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Block.glass});
applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png");
ModLoader.addName(applejuice, "Apple Juice");
ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup});
donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png");
ModLoader.addName(donut, "Donut");
ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat});
glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png");
ModLoader.addName(glazeddonut, "Glazed Donut");
ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut});
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
ModLoader.registerBlock(aliengrass);
ModLoader.aliengrass(aliengrass, "Alien Grass");
ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt});
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
aliengrass.java
package net.minecraft.src;
public class aliengrass extends Block
{
public aliengrass(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_MangMod.aliengrassBottom;
}
if (i == 1)
{
return mod_MangMod.aliengrassTop;
}
else
{
return mod_MangMod.aliengrassSides;
}
}
}
got a problem when I tried to create my first block
package net.minecraft.src;
public class mod_Block extends Basemod
{
public static final Block CobblestoneBrick = new CobblestoneBrick(123, 0, Material.rock).setBlockName("cobblestone brick").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
CobblestoneBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp62/eclipse/Client/bin/mods/Paranoidweazle's CastleMod v1.0/CobblestoneBrick.png");
ModLoader.registerBlock(CobblestoneBrick);
ModLoader.addName(CobblestoneBrick, "Cobblestone Brick");
ModLoader.addRecipe(new ItemStack(CobblestoneBrick, 4), new Object [] {"##", "##", Character.valueOf('#'), Block.cobblestone});
}
public String getVersion()
{
return "1.2.5";
}
}
here is the cobblestone brick code, I did not get any errors, but for some reason I could not craft the cobblestone brick when I tested the mod. you might also want to get the texture file path changed, because I created a custom texture for it. I do not think the mod has any special features (also could you please tell me what counts as a special feature?), so I did not make a class for the brick. it's much like a stone brick, except made of cobblestone
BUT, I did get 2 minor errors when I coded it in eclipse. The first one is "Basemod cannot be resolved to a type. second one is "CobblestoneBrick cannot be resolved to a type"
got a problem when I tried to create my first block
package net.minecraft.src;
public class mod_Block extends Basemod
{
public static final Block CobblestoneBrick = new CobblestoneBrick(123, 0, Material.rock).setBlockName("cobblestone brick").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
CobblestoneBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp62/eclipse/Client/bin/mods/Paranoidweazle's CastleMod v1.0/CobblestoneBrick.png");
ModLoader.registerBlock(CobblestoneBrick);
ModLoader.addName(CobblestoneBrick, "Cobblestone Brick");
ModLoader.addRecipe(new ItemStack(CobblestoneBrick, 4), new Object [] {"##", "##", Character.valueOf('#'), Block.cobblestone});
}
public String getVersion()
{
return "1.2.5";
}
}
here is the cobblestone brick code, I did not get any errors, but for some reason I could not craft the cobblestone brick when I tested the mod. you might also want to get the texture file path changed, because I created a custom texture for it. I do not think the mod has any special features (also could you please tell me what counts as a special feature?), so I did not make a class for the brick. it's much like a stone brick, except made of cobblestone
BUT, I did get 2 minor errors when I coded it in eclipse. The first one is "Basemod cannot be resolved to a type. second one is "CobblestoneBrick cannot be resolved to a type"
thanks for any help
edit: sorry don't know how to spoiler tag it :/
Did you put ModLoader into minecraft.jar before decompiling?
EDIT: A special feature is like if you want it to drop something besides what it is, like stone dropping cobblestone, or diamond ore dropping diamond. Or something like making it change textures when powered by redstone. Things like that.
2. The texture isnt meant to be outside of the minecraft.jar - make a folder called "Mineputertextures" and put all the textures in and reput the links to te override pictures eg. /mineputertextures/orangebricks.png
package net.minecraft.src;
import java.util.Map;
public class mod_MangMod extends BaseMod
{
public static final Item glasscup = new Item(5000).setItemName("glasscup");
public static final Item applejuice = new Item(5001).setItemName("applejuice");
public static final Item donut = new Item(5002).setItemName("donut");
public static final Item glazeddonut = new Item(5003).setItemName("glazeddonut");
public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(1F);
public static int aliengrassBottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png");
public static int aliengrassTop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png");
public static int aliengrassSides = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public void load()
{
ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
BiomeGenBase.plains,
BiomeGenBase.desert,
BiomeGenBase.desertHills,
BiomeGenBase.beach,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.forest,
BiomeGenBase.forestHills,
BiomeGenBase.taiga,
BiomeGenBase.taigaHills,
BiomeGenBase.swampland,
BiomeGenBase.river,
BiomeGenBase.jungle,
BiomeGenBase.jungleHills
});
glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png");
ModLoader.addName(glasscup, "Glass Cup");
ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Block.glass});
applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png");
ModLoader.addName(applejuice, "Apple Juice");
ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup});
donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png");
ModLoader.addName(donut, "Donut");
ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat});
glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png");
ModLoader.addName(glazeddonut, "Glazed Donut");
ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut});
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
ModLoader.registerBlock(aliengrass);
ModLoader.aliengrass(aliengrass, "Alien Grass");
ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt});
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
aliengrass.java
package net.minecraft.src;
public class aliengrass extends Block
{
public aliengrass(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_MangMod.aliengrassBottom;
}
if (i == 1)
{
return mod_MangMod.aliengrassTop;
}
else
{
return mod_MangMod.aliengrassSides;
}
}
}
package net.minecraft.src;
import java.util.Map;
public class mod_MangMod extends BaseMod
{
public static final Item glasscup = new Item(5000).setItemName("glasscup");
public static final Item applejuice = new Item(5001).setItemName("applejuice");
public static final Item donut = new Item(5002).setItemName("donut");
public static final Item glazeddonut = new Item(5003).setItemName("glazeddonut");
public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(1F);
public static int aliengrassBottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png");
public static int aliengrassTop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png");
public static int aliengrassSides = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public void load()
{
ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
BiomeGenBase.plains,
BiomeGenBase.desert,
BiomeGenBase.desertHills,
BiomeGenBase.beach,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.forest,
BiomeGenBase.forestHills,
BiomeGenBase.taiga,
BiomeGenBase.taigaHills,
BiomeGenBase.swampland,
BiomeGenBase.river,
BiomeGenBase.jungle,
BiomeGenBase.jungleHills
});
glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png");
ModLoader.addName(glasscup, "Glass Cup");
ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Block.glass});
applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png");
ModLoader.addName(applejuice, "Apple Juice");
ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup});
donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png");
ModLoader.addName(donut, "Donut");
ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat});
glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png");
ModLoader.addName(glazeddonut, "Glazed Donut");
ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut});
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
ModLoader.registerBlock(aliengrass);
ModLoader.aliengrass(aliengrass, "Alien Grass");
ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt});
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
aliengrass.java
package net.minecraft.src;
public class aliengrass extends Block
{
public aliengrass(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_MangMod.aliengrassBottom;
}
if (i == 1)
{
return mod_MangMod.aliengrassTop;
}
else
{
return mod_MangMod.aliengrassSides;
}
}
}
Thanks for the help guys
made some changes, also I did not forget to add the modloader, turns out I forgot to capitalize the M in BaseMod
but now I got an actual error when I ran the game.
error report:
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 6/9/12 11:32 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_25, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 3450 version 2.1.8787, ATI Technologies Inc.
java.lang.Error: Unresolved compilation problem:
The method setBlockName(String) is undefined for the type BlockCobblestoneBrick
at net.minecraft.src.mod_Block.<init>(mod_Block.java:6)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ebf282c ----------
code for the 2 files I created:
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block CobblestoneBrick = new BlockCobblestoneBrick(123, 0) .setBlockName("cobblestone brick").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
CobblestoneBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp62/eclipse/Client/bin/mods/Paranoidweazle's CastleMod v1.0/CobblestoneBrick.png");
ModLoader.registerBlock(CobblestoneBrick);
ModLoader.addName(CobblestoneBrick, "Cobblestone Brick");
ModLoader.addRecipe(new ItemStack(CobblestoneBrick, 4), new Object [] {"##", "##", Character.valueOf('#'), Block.cobblestone});
}
public String getVersion()
{
return "1.2.5";
}
}
for this code, in eclipse, it told me that there was an error in .setBlockName: The method setBlockName(String) is undefined for the type BlockCobblestoneBrick
package net.minecraft.src;
import java.util.Random;
public class BlockCobblestoneBrick
{
public BlockCobblestoneBrick(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.CobblestoneBrick.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
as for this one, an error in line 9, super(i, j, Material.rock); : The constructor Object(int, int, Material) is undefined, what would I use to define it? the tutorial wasn't too clear on that part :/
- obvo change "EntitySadCreeper" to whatever your entity is called
- "Sad Creeper" change to ingame name
- Change 61 to and unused id eg.101 (or whatever id youve already given your mob)
-then change the "0xf6b201, 0xfff87e" for 2 colours of the egg (you should do it like the others so that the egg is recognisable when you see it and can think back to seeing the mob)
here is a link to hex colours: Color Codes
You can add spawn eggs with ModLoader. Instead of editing EntityList, you just put the colour codes after the mods entity id when you register it.
At this current point, if you were to run it, the name of the spawn egg would say:
"Spawn entity.SadCreeper.name"
We don't want it to say that, so we use ModLoader to change it before it is rendered.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I am making a mod where it will add mobs to the world and I finally got one of my tests to spawn in the world (after literally over 16 hours) and I wanted to make another mob but i'm confused on what do. Do I need to add the Modloader.register thing to my mod_ file again? Or do I need to make another mod_ file for each specific mob?
Great tutorials! Just one question. How do you get the block to look like your texture if its in your inventory. When I pick up my block, it is purple and when I place it again it is still purple. I know that means missing texture so where do you put the texture?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummod_Mangmod.java
package net.minecraft.src; import java.util.Map; public class mod_MangMod extends BaseMod { public static final Item glasscup = new Item(5000).setItemName("glasscup"); public static final Item applejuice = new Item(5001).setItemName("applejuice"); public static final Item donut = new Item(5002).setItemName("donut"); public static final Item glazeddonut = new Item(5003).setItemName("glazeddonut"); public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(1F); public static int aliengrassBottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png"); public static int aliengrassTop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png"); public static int aliengrassSides = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); public void load() { ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.taiga, BiomeGenBase.taigaHills, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.jungle, BiomeGenBase.jungleHills }); glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png"); ModLoader.addName(glasscup, "Glass Cup"); ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Block.glass}); applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png"); ModLoader.addName(applejuice, "Apple Juice"); ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup}); donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png"); ModLoader.addName(donut, "Donut"); ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat}); glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png"); ModLoader.addName(glazeddonut, "Glazed Donut"); ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut}); Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); ModLoader.registerBlock(aliengrass); ModLoader.aliengrass(aliengrass, "Alien Grass"); ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt}); } public void addRenderer(Map map) { map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F)); } public String getVersion() { return "1.2.5"; } }aliengrass.java
package net.minecraft.src; public class aliengrass extends Block { public aliengrass(int i, int j) { super(i, j, Material.wood); } public int getBlockTextureFromSideAndMetadata(int i, int j) { return getBlockTextureFromSide(i); } public int getBlockTextureFromSide(int i) { if (i == 0) { return mod_MangMod.aliengrassBottom; } if (i == 1) { return mod_MangMod.aliengrassTop; } else { return mod_MangMod.aliengrassSides; } } }It's a dye, so it doesn't have a reference like those. Also, dirt isn't an item
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCode please
I'm not sure, but I know it's part of (I think) and then some other stuff afterwards to get which one you want. Try looking in Items for lapis.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumpublic class mod_newbricks extends BaseMod
{
public static final Block OrangeBrick = new Block(200,0,Material.rock).setBlockName("Orange Brick").setHardness(4F).setResistance(4F);
public void load()
{
OrangeBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/mcp/eclipse/Client/bin/orangebrick.png");
ModLoader.registerBlock(OrangeBrick);
ModLoader.addName(OrangeBrick,"Orange Brick");
ModLoader.addShapelessRecipe(new ItemStack(OrangeBrick,1),new Object[]{"#","$",Character.valueOf('#'),Block.brick,Character.valueOf('$'),new ItemStack(Item.dyePowder,1,14)});
}
public String getVersion()
{
return "1.2.5";
}
}
So I did that code and got this error:
Caused by:
java.lang.RuntimeException: Invalid shapeless recipy!
at net.minecraft.src.CraftingManager.addShapelessRecipe(
CraftingManager.java:437)
at net.minecraft.src.ModLoader.addShapelessRecipe(
ModLoader.java:417)
at net.minecraft.src.mod_newbricks.load(
mod_newbricks.java:10)
at net.minecraft.src.ModLoader.init(
ModLoader.java:856)
... 6 more
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumpackage net.minecraft.src; public class mod_Block extends Basemod { public static final Block CobblestoneBrick = new CobblestoneBrick(123, 0, Material.rock).setBlockName("cobblestone brick").setHardness(3F).setResistance(4F).setLightValue(1F); public void load() { CobblestoneBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp62/eclipse/Client/bin/mods/Paranoidweazle's CastleMod v1.0/CobblestoneBrick.png"); ModLoader.registerBlock(CobblestoneBrick); ModLoader.addName(CobblestoneBrick, "Cobblestone Brick"); ModLoader.addRecipe(new ItemStack(CobblestoneBrick, 4), new Object [] {"##", "##", Character.valueOf('#'), Block.cobblestone}); } public String getVersion() { return "1.2.5"; } }here is the cobblestone brick code, I did not get any errors, but for some reason I could not craft the cobblestone brick when I tested the mod. you might also want to get the texture file path changed, because I created a custom texture for it. I do not think the mod has any special features (also could you please tell me what counts as a special feature?), so I did not make a class for the brick. it's much like a stone brick, except made of cobblestone
BUT, I did get 2 minor errors when I coded it in eclipse. The first one is "Basemod cannot be resolved to a type. second one is "CobblestoneBrick cannot be resolved to a type"
thanks for any help
edit: sorry don't know how to spoiler tag it :/
Did you put ModLoader into minecraft.jar before decompiling?
EDIT: A special feature is like if you want it to drop something besides what it is, like stone dropping cobblestone, or diamond ore dropping diamond. Or something like making it change textures when powered by redstone. Things like that.
Also, on how to make spoilers:
Remember to add the '/' on the second one.
Thanks
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCould someone help? I've been ignored 4 times...
Lead Ore, Lead Block, Diamond & Gold Alloy, Lead, and Lead Ingot
Thanks TechGuy. I'll give you credit for helping me because of the tuts ^^
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumhttp://www.minecraftforum.net/topic/445326-125-strongs-ores-v10-modloader/page__fromsearch__1Weegeemang, I have no idea what is wrong with your code. If no one fixes it while I'm sleeping, I'll try and fix it tomorrow.
made some changes, also I did not forget to add the modloader, turns out I forgot to capitalize the M in BaseMod
but now I got an actual error when I ran the game.
error report:
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 6/9/12 11:32 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_25, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 3450 version 2.1.8787, ATI Technologies Inc.
java.lang.Error: Unresolved compilation problem:
The method setBlockName(String) is undefined for the type BlockCobblestoneBrick
at net.minecraft.src.mod_Block.<init>(mod_Block.java:6)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ebf282c ----------
code for the 2 files I created:
package net.minecraft.src; public class mod_Block extends BaseMod { public static final Block CobblestoneBrick = new BlockCobblestoneBrick(123, 0) .setBlockName("cobblestone brick").setHardness(3F).setResistance(4F).setLightValue(1F); public void load() { CobblestoneBrick.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp62/eclipse/Client/bin/mods/Paranoidweazle's CastleMod v1.0/CobblestoneBrick.png"); ModLoader.registerBlock(CobblestoneBrick); ModLoader.addName(CobblestoneBrick, "Cobblestone Brick"); ModLoader.addRecipe(new ItemStack(CobblestoneBrick, 4), new Object [] {"##", "##", Character.valueOf('#'), Block.cobblestone}); } public String getVersion() { return "1.2.5"; } }for this code, in eclipse, it told me that there was an error in .setBlockName: The method setBlockName(String) is undefined for the type BlockCobblestoneBrick
package net.minecraft.src; import java.util.Random; public class BlockCobblestoneBrick { public BlockCobblestoneBrick(int i, int j) { super(i, j, Material.rock); } public int idDropped(int i, Random random, int j) { return mod_Block.CobblestoneBrick.blockID; } public int quantityDropped(Random random) { return 1; } }as for this one, an error in line 9, super(i, j, Material.rock); : The constructor Object(int, int, Material) is undefined, what would I use to define it? the tutorial wasn't too clear on that part :/
again, thanks for any help
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummod_MangMod
package net.minecraft.src; import java.util.Map; public class mod_MangMod extends BaseMod { public static final Item glasscup = new Item(5000).setItemName("glasscup"); public static final Item applejuice = new Item(5001).setItemName("applejuice"); public static final Item donut = new Item(5002).setItemName("donut"); public static final Item glazeddonut = new Item(5003).setItemName("glazeddonut"); public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket"); public static final Item orange = new Item(5005).setItemName("orange"); public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(0F); public static int aliengrassBottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png"); public static int aliengrassTop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png"); public static int aliengrassSides = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); public void load() { ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.taiga, BiomeGenBase.taigaHills, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.jungle, BiomeGenBase.jungleHills }); glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png"); ModLoader.addName(glasscup, "Glass Cup"); ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Block.glass}); applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png"); ModLoader.addName(applejuice, "Apple Juice"); ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup}); donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png"); ModLoader.addName(donut, "Donut"); ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat}); glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png"); ModLoader.addName(glazeddonut, "Glazed Donut"); ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut}); diamondbucket.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/diamondbucket.png"); ModLoader.addName(diamondbucket, "Diamond Bucket"); ModLoader.addRecipe(new ItemStack(diamondbucket, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Item.diamond}); orange.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/orange.png"); ModLoader.addName(orange, "Orange"); aliengrass.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); ModLoader.registerBlock(aliengrass); ModLoader.addName(aliengrass, "Alien Grass"); ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt}); } public void addRenderer(Map map) { map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F)); } public String getVersion() { return "1.2.5"; } }You can add spawn eggs with ModLoader. Instead of editing EntityList, you just put the colour codes after the mods entity id when you register it.
At this current point, if you were to run it, the name of the spawn egg would say:
"Spawn entity.SadCreeper.name"
We don't want it to say that, so we use ModLoader to change it before it is rendered.
ModLoader.addLocalization("entity.SadCreeper.name", "Sad Creeper");Then the egg will say:
"Spawn Sad Creeper"
together they are powerful beyond imagination."
EX. mod_Item mod_Item2
I am making a mod where it will add mobs to the world and I finally got one of my tests to spawn in the world (after literally over 16 hours) and I wanted to make another mob but i'm confused on what do. Do I need to add the Modloader.register thing to my mod_ file again? Or do I need to make another mod_ file for each specific mob?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYours:
public static final Block aliengrass = new aliengrass(160, 0).setaliengrass("Alien Grass").setHardness(0.5F).setResistance(4F).setLightValue(0F);Should be:
public static final Block aliengrass = new aliengrass(160, 0).setBlockName("aliengrass").setHardness(0.5F).setResistance(4F);You set the name for your block the same way you do with items, which is the ModLoader.addName function. (The one you used for applejuice and such)
So, somewhere under your public void load(), there should be a:
Hope that helps.