//this all goes inside the onFoodEaten method.
int i = Random.nextInt(9);
if(i == 5)
{
//Potion Effects in here.
}
We set i to be equal to Random.nextInt(9). The nextInt method gets a random number between 0 and the number given. In this case that number is 9. Yes, even though that number is 9, it is a 1 in 10 chance. This is because 0 can be selected as well. Then if just says "if i is equal to 5, then apply the specfied potion effect/s". Don't forget to import Random like Keydara showed.
Hmm, i tried but it didn't work. This is what i have:
package net.minecraft.src;
import java.util.Random;
public class ItemLastDaysDrug1 extends ItemFood
{
public ItemLastDaysDrug1(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.resistance.id, 30 * 20, 10));
entityPlayer.addPotionEffect(new PotionEffect(Potion.heal.id, 30 * 20, 1));
entityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 30 * 20, 10));
int i = Random.nextInt(9);
if(i == 5)
{
entityPlayer.addPotionEffect(new PotionEffect(Potion.poison.id, 30 * 20, 0));
}
return itemStack;
}
{
}
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return EnumRarity.epic;
}
}
and it says at Random.nextInt(9); "Cannot make a static reference to the non-static method next Int(int) from the type Random"
Could you give me an example how to implement a custom chest? If not too time-consuming with a custom UI?
And how could one create/read external textfiles?
Sorry but I can't. It would take up a lot of time. This page may help you with reading text files. I haven't done file reading and writing in Java yet so I can't assist with it.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Random random = new Random();
int i = random.nextInt(9);
Keep everything else how it is though.
snip
It didn't do anything at all, even by itself, i put it to a 50% chance of poison and i used a whole stack of stuff and it didn't give me any poison. This is what i got:
package net.minecraft.src;
import java.util.Random;
public class ItemLastDaysDrug1 extends ItemFood
{
public ItemLastDaysDrug1(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.resistance.id, 30 * 20, 10));
entityPlayer.addPotionEffect(new PotionEffect(Potion.heal.id, 30 * 20, 1));
entityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 30 * 20, 10));
Random random = new Random();
int i = random.nextInt(5);
if(i == 5)
{
entityPlayer.addPotionEffect(new PotionEffect(Potion.poison.id, 30 * 20, 0));
}
return itemStack;
}
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return EnumRarity.epic;
}
}
BTW the rarity thing doesn't work, but it's still in there
And adding that didn't do anything as i said.
it said i had to remove the 'final' statment for canDropItself in BlockPaneMod. when i did that and ran the program it gave me this error when i tried to open the world. i started a new world, everthing was fine til i placed the block, then it gave me the same error message.
Mods loaded: 2
ModLoader 1.2.5
mod_electricfence Electric Fence V1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT ea3da9d --------
Generated 6/23/12 11:11 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_01, Oracle Corporation
VM: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: AMD Radeonâ„¢ HD 6520G version 4.1.11159 Compatibility Profile Context, ATI Technologies Inc.
java.lang.ClassCastException: net.minecraft.src.BlockElectricFence cannot be cast to net.minecraft.src.BlockPane
at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:399)
at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:226)
at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1450)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1107)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b1b8a9ec ----------
A few more questions: I'm using eclipse so you know. When you compile it with mcp where does the compiled class go to? I thought it was in mcp\bin\minecraft\net\minecraft\src but when I dragged it in to minecraft.jar I got a crash. It worked fine when I tested it in eclipse.
Question 2: You said for .setLightValue that the higher a number, the brighter it is. At brightness level (1F) it was about the brightness of glowstone. The brighter I made it, the darker it got. (I wanted glowbrick to be brighter than glowstone)
Question 3: Is there a way to make mining speeds faster? (1F) was the speed of brick and I want some blocks to be slower than 1F. Higher numbers are even slower.
Question 4: You know how some blocks share data values? Like they have the id, a colon, and then another number on the other side of the colon. (Like half slabs) How do you do that? I have a bunch of bricks that are exactly the same, but just a different texture and crafting recipe.
Question 5: How do you change the sound of a block? I have a block with glass material that still makes a stone sound.
can you make a tutorial for how to make an item throwable? for instance i have a dagger and i want to be able to throw it. if not its okay but just wondering.
I'm trying to make my food item use its own class, but I am getting an error. http://imgur.com/Vi1g3
mod_MangMod
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
import java.util.List;
public class mod_MangMod extends BaseMod
{
public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F);
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 aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F);
public static final Block alienplank = new alienplank(127, 0).setBlockName("alienplank").setHardness(2F).setResistance(5F);
public static final Block aliencob = new aliencob(128, 0).setBlockName("aliencob").setHardness(2F).setResistance(10F);
public static final Block alienore = new alienore(129, 0).setBlockName("alienore").setHardness(3F).setResistance(5F);
public static final Block alienlog = new alienlog(130, 0).setBlockName("alienlog").setHardness(2F).setResistance(5F);
public static int alienlogbottom = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog1.png");
public static int alienlogtop = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog2.png");
public static int alienlogside = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog3.png");
public static final Block alienleaf = new alienleaf(131, 0).setBlockName("alienleaf").setHardness(2F);
public static final Item cactusjuice = new cactusjuice(5000, 5, 2F, false).setItemName("cactusjuice");
public static final Item applejuice = new ItemFood(5001, 9, 2F, false).setItemName("applejuice");
public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut");
public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut");
public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket");
public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange");
public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon");
public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich");
public static final Item tinyalien = new tinyalien(5008).setItemName("tinyalien");
public static final Item tinysteve = new tinysteve(5009).setItemName("tinysteve");
public static final Item tinyzombie = new tinyzombie(5010).setItemName("tinyzombie");
public static final Item alienflesh = new Item(5011).setItemName("alienflesh");
public static final Item lemon = new lemon(5012).setItemName("lemon");
public static final Item actweegee = new actweegee(5013).setItemName("actweegee");
public static final Item ivspawner = new ivspawner(5014).setItemName("ivspawner");
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
});
ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienruffian.class, 40, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(alienarcher.class, "alienarcher", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienarcher.class, 40, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(tinyzombie2.class, "Tiny Zombie", ModLoader.getUniqueEntityId());
ModLoader.registerEntityID(actweegee2.class, "actweegee2", ModLoader.getUniqueEntityId());
ModLoader.registerBlock(aliengrass);
ModLoader.addName(aliengrass, "Alien Grass");
aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png");
ModLoader.registerBlock(aliendirt);
ModLoader.addName(aliendirt, "Alien Dirt");
alienplank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienplank.png");
ModLoader.registerBlock(alienplank);
ModLoader.addName(alienplank, "Alien Plank");
aliencob.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliencob.png");
ModLoader.registerBlock(aliencob);
ModLoader.addName(aliencob, "Alien Cobblestone");
alienore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienore.png");
ModLoader.registerBlock(alienore);
ModLoader.addName(alienore, "Uralium Ore");
ModLoader.registerBlock(alienlog);
ModLoader.addName(alienlog, "Alien Log");
alienleaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienleaf.png");
ModLoader.registerBlock(alienleaf);
ModLoader.addName(alienleaf, "Alien Leaves");
cactusjuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/cactusjuice.png");
ModLoader.addName(cactusjuice, "Cactus Juice");
ModLoader.addRecipe(new ItemStack(cactusjuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Block.cactus, Character.valueOf('%'), Item.glassBottle});
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('%'), Item.glassBottle});
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");
bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png");
ModLoader.addName(bacon, "Bacon");
ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1));
eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png");
ModLoader.addName(eggsandwich, "Egg Sandwich");
ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg});
tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png");
ModLoader.addName(tinyalien, "Tiny Alien");
ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond});
tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png");
ModLoader.addName(tinyzombie, "Tiny Zombie");
ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond});
tinysteve.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinysteve.png");
ModLoader.addName(tinysteve, "Tiny Steve");
ModLoader.addRecipe(new ItemStack(tinysteve, 1), new Object [] {"#", "%", Character.valueOf('#'), Block.cake, Character.valueOf('%'), tinysteve});
alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png");
ModLoader.addName(alienflesh, "Alien Flesh");
lemon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/lemon.png");
ModLoader.addName(lemon, "Lemon");
actweegee.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/weegeeicon.png");
ModLoader.addName(actweegee, "Weegeemang Action Figure");
ModLoader.addRecipe(new ItemStack(actweegee, 1), new Object [] {"###", "#%#", "$$$", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('%'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('$'), new ItemStack(Block.cloth, 1, 0)});
ivspawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/ivspawner.png");
ModLoader.addName(ivspawner, "Innocent Villager");
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(tinyzombie2.class, new RenderBiped(new ModelZombie(), 0.5F));
map.put(alienruffian.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(alienarcher.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(actweegee2.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
cactusjuice
package net.minecraft.src;
public class cactusjuice extends ItemFood
{
public cactusjuice(int i, int j, boolean
{
super(i, j, B);
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
return new ItemStack(Item.glassBottle);
}
}
A few more questions: I'm using eclipse so you know. When you compile it with mcp where does the compiled class go to? I thought it was in mcp\bin\minecraft\net\minecraft\src but when I dragged it in to minecraft.jar I got a crash. It worked fine when I tested it in eclipse.
Question 2: You said for .setLightValue that the higher a number, the brighter it is. At brightness level (1F) it was about the brightness of glowstone. The brighter I made it, the darker it got. (I wanted glowbrick to be brighter than glowstone)
Question 3: Is there a way to make mining speeds faster? (1F) was the speed of brick and I want some blocks to be slower than 1F. Higher numbers are even slower.
Question 4: You know how some blocks share data values? Like they have the id, a colon, and then another number on the other side of the colon. (Like half slabs) How do you do that? I have a bunch of bricks that are exactly the same, but just a different texture and crafting recipe.
Question 5: How do you change the sound of a block? I have a block with glass material that still makes a stone sound.
Ok so questions 1, 3 and 5 are answered. For question 2 doing 2.0F still made it darker than 1F. Anyone know the answer to questions 2 and 4?
First, you could make 2 seperate class files.
if you just want to change the code make it look like this:
package net.minecraft.src;
import java.util.List;
public class mod_file extends BaseMod
{
public static final Item item = new Item(140).setItemName("Item");
public static final Block block = new Block(141, Material.wood)setHardness(1.0F).setResistance(3.0F).setBlockName("Block");
public void load()
{
ModLoader.addName(item,"item");
ModLoader.addName(block,"block");
}
public String getVersion();
{
return "1.2.5";
}
}
java.lang.Error: Unresolved compilation problems:
Duplicate method load() in type mod_More_Food
Duplicate method getVersion() in type mod_More_Food
Duplicate method getVersion() in type mod_More_Food
Duplicate method load() in type mod_More_Food
at net.minecraft.src.mod_More_Food.<init>(mod_More_Food.java:7)
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 45041138 ----------
look at the top of the error, it's pretty obvious, you have duplicate load, and getversion methods, you can only have one per that file.
It didn't do anything at all, even by itself, i put it to a 50% chance of poison and i used a whole stack of stuff and it didn't give me any poison. This is what i got:
package net.minecraft.src;
import java.util.Random;
public class ItemLastDaysDrug1 extends ItemFood
{
public ItemLastDaysDrug1(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.resistance.id, 30 * 20, 10));
entityPlayer.addPotionEffect(new PotionEffect(Potion.heal.id, 30 * 20, 1));
entityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 30 * 20, 10));
Random random = new Random();
int i = random.nextInt(5);
if(i == 5)
{
entityPlayer.addPotionEffect(new PotionEffect(Potion.poison.id, 30 * 20, 0));
}
return itemStack;
}
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return EnumRarity.epic;
}
}
BTW the rarity thing doesn't work, but it's still in there
And adding that didn't do anything as i said.
Try changing the 0 in the poison line to something like 6. I know I said in the tutorial that you could leave it as zero but try changing it.
it said i had to remove the 'final' statment for canDropItself in BlockPaneMod. when i did that and ran the program it gave me this error when i tried to open the world. i started a new world, everthing was fine til i placed the block, then it gave me the same error message.
Mods loaded: 2
ModLoader 1.2.5
mod_electricfence Electric Fence V1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT ea3da9d --------
Generated 6/23/12 11:11 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_01, Oracle Corporation
VM: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: AMD Radeonâ„¢ HD 6520G version 4.1.11159 Compatibility Profile Context, ATI Technologies Inc.
java.lang.ClassCastException: net.minecraft.src.BlockElectricFence cannot be cast to net.minecraft.src.BlockPane
at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:399)
at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:226)
at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1450)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1107)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b1b8a9ec ----------
It is probably being caused by RenderBlocks being told that your block class is an instance of BlockPane when it isn't. RenderBlocks is told that in the getRenderType() method. Depending on what number is returned, a different render type is used. Try making your block class extend BlockPane. If it doesn't work then you may have to wait until I can figure it out and make a tutorial on it.
I'm trying to make my food item use its own class, but I am getting an error. http://imgur.com/Vi1g3
mod_MangMod
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
import java.util.List;
public class mod_MangMod extends BaseMod
{
public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F);
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 aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F);
public static final Block alienplank = new alienplank(127, 0).setBlockName("alienplank").setHardness(2F).setResistance(5F);
public static final Block aliencob = new aliencob(128, 0).setBlockName("aliencob").setHardness(2F).setResistance(10F);
public static final Block alienore = new alienore(129, 0).setBlockName("alienore").setHardness(3F).setResistance(5F);
public static final Block alienlog = new alienlog(130, 0).setBlockName("alienlog").setHardness(2F).setResistance(5F);
public static int alienlogbottom = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog1.png");
public static int alienlogtop = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog2.png");
public static int alienlogside = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog3.png");
public static final Block alienleaf = new alienleaf(131, 0).setBlockName("alienleaf").setHardness(2F);
public static final Item cactusjuice = new cactusjuice(5000, 5, 2F, false).setItemName("cactusjuice");
public static final Item applejuice = new ItemFood(5001, 9, 2F, false).setItemName("applejuice");
public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut");
public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut");
public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket");
public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange");
public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon");
public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich");
public static final Item tinyalien = new tinyalien(5008).setItemName("tinyalien");
public static final Item tinysteve = new tinysteve(5009).setItemName("tinysteve");
public static final Item tinyzombie = new tinyzombie(5010).setItemName("tinyzombie");
public static final Item alienflesh = new Item(5011).setItemName("alienflesh");
public static final Item lemon = new lemon(5012).setItemName("lemon");
public static final Item actweegee = new actweegee(5013).setItemName("actweegee");
public static final Item ivspawner = new ivspawner(5014).setItemName("ivspawner");
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
});
ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienruffian.class, 40, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(alienarcher.class, "alienarcher", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienarcher.class, 40, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(tinyzombie2.class, "Tiny Zombie", ModLoader.getUniqueEntityId());
ModLoader.registerEntityID(actweegee2.class, "actweegee2", ModLoader.getUniqueEntityId());
ModLoader.registerBlock(aliengrass);
ModLoader.addName(aliengrass, "Alien Grass");
aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png");
ModLoader.registerBlock(aliendirt);
ModLoader.addName(aliendirt, "Alien Dirt");
alienplank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienplank.png");
ModLoader.registerBlock(alienplank);
ModLoader.addName(alienplank, "Alien Plank");
aliencob.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliencob.png");
ModLoader.registerBlock(aliencob);
ModLoader.addName(aliencob, "Alien Cobblestone");
alienore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienore.png");
ModLoader.registerBlock(alienore);
ModLoader.addName(alienore, "Uralium Ore");
ModLoader.registerBlock(alienlog);
ModLoader.addName(alienlog, "Alien Log");
alienleaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienleaf.png");
ModLoader.registerBlock(alienleaf);
ModLoader.addName(alienleaf, "Alien Leaves");
cactusjuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/cactusjuice.png");
ModLoader.addName(cactusjuice, "Cactus Juice");
ModLoader.addRecipe(new ItemStack(cactusjuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Block.cactus, Character.valueOf('%'), Item.glassBottle});
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('%'), Item.glassBottle});
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");
bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png");
ModLoader.addName(bacon, "Bacon");
ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1));
eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png");
ModLoader.addName(eggsandwich, "Egg Sandwich");
ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg});
tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png");
ModLoader.addName(tinyalien, "Tiny Alien");
ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond});
tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png");
ModLoader.addName(tinyzombie, "Tiny Zombie");
ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond});
tinysteve.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinysteve.png");
ModLoader.addName(tinysteve, "Tiny Steve");
ModLoader.addRecipe(new ItemStack(tinysteve, 1), new Object [] {"#", "%", Character.valueOf('#'), Block.cake, Character.valueOf('%'), tinysteve});
alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png");
ModLoader.addName(alienflesh, "Alien Flesh");
lemon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/lemon.png");
ModLoader.addName(lemon, "Lemon");
actweegee.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/weegeeicon.png");
ModLoader.addName(actweegee, "Weegeemang Action Figure");
ModLoader.addRecipe(new ItemStack(actweegee, 1), new Object [] {"###", "#%#", "$$$", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('%'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('$'), new ItemStack(Block.cloth, 1, 0)});
ivspawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/ivspawner.png");
ModLoader.addName(ivspawner, "Innocent Villager");
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(tinyzombie2.class, new RenderBiped(new ModelZombie(), 0.5F));
map.put(alienruffian.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(alienarcher.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(actweegee2.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
cactusjuice
package net.minecraft.src;
public class cactusjuice extends ItemFood
{
public cactusjuice(int i, int j, boolean
{
super(i, j, B);
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
return new ItemStack(Item.glassBottle);
}
}
Remove the 2F from the public static final line of the food.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Try changing the 0 in the poison line to something like 6. I know I said in the tutorial that you could leave it as zero but try changing it.
Is that the number you said you weren't quite sure about? Cause I have been modding a lot recently and I also discovered what it does. For all that don't know, it is the level the potion effect is plus 1. E.g: If you have regeneration with a 3 in there, it will be a potion effect of regeneration IV. Though making it any higher won't work, as all potions have a max level of IV.
Anyway, I like the new tutorials. Especially the new one where it shows you how to do multiple potion effects on a food, I've been wondering how to do that for a while.
Is that the number you said you weren't quite sure about? Cause I have been modding a lot recently and I also discovered what it does. For all that don't know, it is the level the potion effect is plus 1. E.g: If you have regeneration with a 3 in there, it will be a potion effect of regeneration IV. Though making it any higher won't work, as all potions have a max level of IV.
Anyway, I like the new tutorials. Especially the new one where it shows you how to do multiple potion effects on a food, I've been wondering how to do that for a while.
Thanks
Thanks setPotionEffect and addPotionEffect have different arguments. The Javadoc says that addPotionEffect's third argument is the amplifier. setPotionEffect has a fourth argument aswell. It is the probability of the potion occurring. I haven't really experimented much with the two methods so your input is greatly appreciated.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
For the NPC how would I get it to spawn that same way golems do, by being built?
Look at BlockPumpkin. It shows several examples of how to do it.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I have a big problem. After numerous different things going on, I am forced to assume that something has gone wrong with my code, and my alien biome no longer "exists" within the game, even though F3 shows 'alienbiome". One thing is that I cannot locate any new alien biomes in my worlds, and existing biomes won't spawn the mobs that were spawning within them. Now, I may just be having bad luck trying to locate new biomes, but my mobs are DEFINITELY not spawning. Help will be greatly appreciated, as this biome is one of the main parts of my mod.
mod_MangMod
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
import java.util.List;
public class mod_MangMod extends BaseMod
{
public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F);
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 aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F);
public static final Block alienplank = new alienplank(127, 0).setBlockName("alienplank").setHardness(2F).setResistance(5F);
public static final Block aliencob = new aliencob(128, 0).setBlockName("aliencob").setHardness(2F).setResistance(10F);
public static final Block alienore = new alienore(129, 0).setBlockName("alienore").setHardness(3F).setResistance(5F);
public static final Block alienlog = new alienlog(130, 0).setBlockName("alienlog").setHardness(2F).setResistance(5F);
public static int alienlogbottom = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog1.png");
public static int alienlogtop = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog2.png");
public static int alienlogside = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog3.png");
public static final Block alienleaf = new alienleaf(131, 0).setBlockName("alienleaf").setHardness(0.2F);
public static final Block alienstone = new alienleaf(132, 0).setBlockName("alienstone").setHardness(1.5F).setResistance(10F);
public static final Item cactusjuice = new cactusjuice(5000, 5, false).setItemName("cactusjuice");
public static final Item applejuice = new applejuice(5001, 9, false).setItemName("applejuice");
public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut");
public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut");
public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket");
public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange");
public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon");
public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich");
public static final Item tinyalien = new tinyalien(5008).setItemName("tinyalien");
public static final Item tinysteve = new tinysteve(5009).setItemName("tinysteve");
public static final Item tinyzombie = new tinyzombie(5010).setItemName("tinyzombie");
public static final Item alienflesh = new Item(5011).setItemName("alienflesh");
public static final Item lemon = new lemon(5012).setItemName("lemon");
public static final Item actweegee = new actweegee(5013).setItemName("actweegee");
public static final Item ivspawner = new ivspawner(5014).setItemName("ivspawner");
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
});
ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienruffian.class, 70, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(alienarcher.class, "alienarcher", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienarcher.class, 70, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(tinyzombie2.class, "Tiny Zombie", ModLoader.getUniqueEntityId());
ModLoader.registerEntityID(actweegee2.class, "actweegee2", ModLoader.getUniqueEntityId());
ModLoader.registerBlock(aliengrass);
ModLoader.addName(aliengrass, "Alien Grass");
aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png");
ModLoader.registerBlock(aliendirt);
ModLoader.addName(aliendirt, "Alien Dirt");
alienplank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienplank.png");
ModLoader.registerBlock(alienplank);
ModLoader.addName(alienplank, "Alien Plank");
aliencob.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliencob.png");
ModLoader.registerBlock(aliencob);
ModLoader.addName(aliencob, "Alien Cobblestone");
alienore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienore.png");
ModLoader.registerBlock(alienore);
ModLoader.addName(alienore, "Uralium Ore");
ModLoader.registerBlock(alienlog);
ModLoader.addName(alienlog, "Alien Log");
alienleaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienleaf.png");
ModLoader.registerBlock(alienleaf);
ModLoader.addName(alienleaf, "Alien Leaves");
alienstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienstone.png");
ModLoader.registerBlock(alienstone);
ModLoader.addName(alienstone, "Alien Stone");
cactusjuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/cactusjuice.png");
ModLoader.addName(cactusjuice, "Cactus Juice");
ModLoader.addRecipe(new ItemStack(cactusjuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Block.cactus, Character.valueOf('%'), Item.glassBottle});
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('%'), Item.glassBottle});
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");
bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png");
ModLoader.addName(bacon, "Bacon");
ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1));
eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png");
ModLoader.addName(eggsandwich, "Egg Sandwich");
ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg});
tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png");
ModLoader.addName(tinyalien, "Tiny Alien");
ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond});
tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png");
ModLoader.addName(tinyzombie, "Tiny Zombie");
ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond});
tinysteve.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinysteve.png");
ModLoader.addName(tinysteve, "Tiny Steve");
ModLoader.addRecipe(new ItemStack(tinysteve, 1), new Object [] {"#", "%", Character.valueOf('#'), Block.cake, Character.valueOf('%'), tinysteve});
alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png");
ModLoader.addName(alienflesh, "Alien Flesh");
lemon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/lemon.png");
ModLoader.addName(lemon, "Lemon");
actweegee.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/weegeeicon.png");
ModLoader.addName(actweegee, "Weegeemang Action Figure");
ModLoader.addRecipe(new ItemStack(actweegee, 1), new Object [] {"###", "#%#", "$$$", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('%'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('$'), new ItemStack(Block.cloth, 1, 0)});
ivspawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/ivspawner.png");
ModLoader.addName(ivspawner, "Innocent Villager");
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(tinyzombie2.class, new RenderBiped(new ModelZombie(), 0.5F));
map.put(alienruffian.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(alienarcher.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(actweegee2.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(lemon2.class, new RenderSnowball(lemon.iconIndex));
}
public String getVersion()
{
return "1.2.5";
}
}
mod_AlienBiome (was told to name it this)
package net.minecraft.src;
public class mod_AlienBiome extends BaseMod
{
public static final BiomeGenBase alienbiome = (new alienbiome(25)).setColor(0x000000).setBiomeName("alienbiome");
public void load()
{
ModLoader.addBiome(alienbiome);
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return "1.2.5";
}
}
alienbiome
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class alienbiome extends BiomeGenBase
{
public alienbiome(int par1)
{
super(par1);
spawnableCreatureList.clear();
topBlock = (byte)mod_MangMod.aliengrass.blockID;
fillerBlock = (byte)mod_MangMod.aliendirt.blockID;
}
}
alienarcher
package net.minecraft.src;
import java.util.Random;
public class alienarcher extends EntityMob
{
public alienarcher(World world)
{
super(world);
texture = "/mangmod/alienarcher.png";
moveSpeed = 0.3F;
attackStrength = 5;
tasks.addTask(1, new EntityAISwimming(this));
tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 1, 60));
tasks.addTask(3, new EntityAIWander(this, moveSpeed));
tasks.addTask(4, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
tasks.addTask(4, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
}
public boolean isAIEnabled()
{
return true;
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected boolean canDespawn()
{
return false;
}
protected int getDropItemId(){
return mod_MangMod.alienflesh.shiftedIndex;
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.bow, 1);
}
private static final ItemStack defaultHeldItem;
}
alienruffian
package net.minecraft.src;
import java.util.Random;
public class alienruffian extends EntityMob
{
public alienruffian(World world)
{
super(world);
texture = "/mangmod/alienruffian.png";
moveSpeed = 0.8F;
attackStrength = 4;
tasks.addTask(0, new EntityAISwimming(this));
tasks.addTask(1, new EntityAIWander(this, moveSpeed));
tasks.addTask(2, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
tasks.addTask(3, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected boolean canDespawn()
{
return false;
}
protected int getDropItemId(){
return mod_MangMod.alienflesh.shiftedIndex;
}
}
I have a big problem. After numerous different things going on, I am forced to assume that something has gone wrong with my code, and my alien biome no longer "exists" within the game, even though F3 shows 'alienbiome". One thing is that I cannot locate any new alien biomes in my worlds, and existing biomes won't spawn the mobs that were spawning within them. Now, I may just be having bad luck trying to locate new biomes, but my mobs are DEFINITELY not spawning. Help will be greatly appreciated, as this biome is one of the main parts of my mod.
mod_MangMod
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
import java.util.List;
public class mod_MangMod extends BaseMod
{
public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F);
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 aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png");
public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F);
public static final Block alienplank = new alienplank(127, 0).setBlockName("alienplank").setHardness(2F).setResistance(5F);
public static final Block aliencob = new aliencob(128, 0).setBlockName("aliencob").setHardness(2F).setResistance(10F);
public static final Block alienore = new alienore(129, 0).setBlockName("alienore").setHardness(3F).setResistance(5F);
public static final Block alienlog = new alienlog(130, 0).setBlockName("alienlog").setHardness(2F).setResistance(5F);
public static int alienlogbottom = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog1.png");
public static int alienlogtop = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog2.png");
public static int alienlogside = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog3.png");
public static final Block alienleaf = new alienleaf(131, 0).setBlockName("alienleaf").setHardness(0.2F);
public static final Block alienstone = new alienleaf(132, 0).setBlockName("alienstone").setHardness(1.5F).setResistance(10F);
public static final Item cactusjuice = new cactusjuice(5000, 5, false).setItemName("cactusjuice");
public static final Item applejuice = new applejuice(5001, 9, false).setItemName("applejuice");
public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut");
public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut");
public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket");
public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange");
public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon");
public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich");
public static final Item tinyalien = new tinyalien(5008).setItemName("tinyalien");
public static final Item tinysteve = new tinysteve(5009).setItemName("tinysteve");
public static final Item tinyzombie = new tinyzombie(5010).setItemName("tinyzombie");
public static final Item alienflesh = new Item(5011).setItemName("alienflesh");
public static final Item lemon = new lemon(5012).setItemName("lemon");
public static final Item actweegee = new actweegee(5013).setItemName("actweegee");
public static final Item ivspawner = new ivspawner(5014).setItemName("ivspawner");
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
});
ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienruffian.class, 70, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(alienarcher.class, "alienarcher", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(alienarcher.class, 70, 1, 1, EnumCreatureType.creature, new BiomeGenBase[]
{
mod_AlienBiome.alienbiome
});
ModLoader.registerEntityID(tinyzombie2.class, "Tiny Zombie", ModLoader.getUniqueEntityId());
ModLoader.registerEntityID(actweegee2.class, "actweegee2", ModLoader.getUniqueEntityId());
ModLoader.registerBlock(aliengrass);
ModLoader.addName(aliengrass, "Alien Grass");
aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png");
ModLoader.registerBlock(aliendirt);
ModLoader.addName(aliendirt, "Alien Dirt");
alienplank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienplank.png");
ModLoader.registerBlock(alienplank);
ModLoader.addName(alienplank, "Alien Plank");
aliencob.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliencob.png");
ModLoader.registerBlock(aliencob);
ModLoader.addName(aliencob, "Alien Cobblestone");
alienore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienore.png");
ModLoader.registerBlock(alienore);
ModLoader.addName(alienore, "Uralium Ore");
ModLoader.registerBlock(alienlog);
ModLoader.addName(alienlog, "Alien Log");
alienleaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienleaf.png");
ModLoader.registerBlock(alienleaf);
ModLoader.addName(alienleaf, "Alien Leaves");
alienstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienstone.png");
ModLoader.registerBlock(alienstone);
ModLoader.addName(alienstone, "Alien Stone");
cactusjuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/cactusjuice.png");
ModLoader.addName(cactusjuice, "Cactus Juice");
ModLoader.addRecipe(new ItemStack(cactusjuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Block.cactus, Character.valueOf('%'), Item.glassBottle});
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('%'), Item.glassBottle});
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");
bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png");
ModLoader.addName(bacon, "Bacon");
ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1));
eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png");
ModLoader.addName(eggsandwich, "Egg Sandwich");
ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg});
tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png");
ModLoader.addName(tinyalien, "Tiny Alien");
ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond});
tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png");
ModLoader.addName(tinyzombie, "Tiny Zombie");
ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond});
tinysteve.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinysteve.png");
ModLoader.addName(tinysteve, "Tiny Steve");
ModLoader.addRecipe(new ItemStack(tinysteve, 1), new Object [] {"#", "%", Character.valueOf('#'), Block.cake, Character.valueOf('%'), tinysteve});
alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png");
ModLoader.addName(alienflesh, "Alien Flesh");
lemon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/lemon.png");
ModLoader.addName(lemon, "Lemon");
actweegee.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/weegeeicon.png");
ModLoader.addName(actweegee, "Weegeemang Action Figure");
ModLoader.addRecipe(new ItemStack(actweegee, 1), new Object [] {"###", "#%#", "$$$", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('%'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('$'), new ItemStack(Block.cloth, 1, 0)});
ivspawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/ivspawner.png");
ModLoader.addName(ivspawner, "Innocent Villager");
}
public void addRenderer(Map map)
{
map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(tinyzombie2.class, new RenderBiped(new ModelZombie(), 0.5F));
map.put(alienruffian.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(alienarcher.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(actweegee2.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(lemon2.class, new RenderSnowball(lemon.iconIndex));
}
public String getVersion()
{
return "1.2.5";
}
}
mod_AlienBiome (was told to name it this)
package net.minecraft.src;
public class mod_AlienBiome extends BaseMod
{
public static final BiomeGenBase alienbiome = (new alienbiome(25)).setColor(0x000000).setBiomeName("alienbiome");
public void load()
{
ModLoader.addBiome(alienbiome);
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return "1.2.5";
}
}
alienbiome
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class alienbiome extends BiomeGenBase
{
public alienbiome(int par1)
{
super(par1);
spawnableCreatureList.clear();
topBlock = (byte)mod_MangMod.aliengrass.blockID;
fillerBlock = (byte)mod_MangMod.aliendirt.blockID;
}
}
alienarcher
package net.minecraft.src;
import java.util.Random;
public class alienarcher extends EntityMob
{
public alienarcher(World world)
{
super(world);
texture = "/mangmod/alienarcher.png";
moveSpeed = 0.3F;
attackStrength = 5;
tasks.addTask(1, new EntityAISwimming(this));
tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 1, 60));
tasks.addTask(3, new EntityAIWander(this, moveSpeed));
tasks.addTask(4, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
tasks.addTask(4, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
}
public boolean isAIEnabled()
{
return true;
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected boolean canDespawn()
{
return false;
}
protected int getDropItemId(){
return mod_MangMod.alienflesh.shiftedIndex;
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.bow, 1);
}
private static final ItemStack defaultHeldItem;
}
alienruffian
package net.minecraft.src;
import java.util.Random;
public class alienruffian extends EntityMob
{
public alienruffian(World world)
{
super(world);
texture = "/mangmod/alienruffian.png";
moveSpeed = 0.8F;
attackStrength = 4;
tasks.addTask(0, new EntityAISwimming(this));
tasks.addTask(1, new EntityAIWander(this, moveSpeed));
tasks.addTask(2, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
tasks.addTask(3, new EntityAILookIdle(this));
targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected boolean canDespawn()
{
return false;
}
protected int getDropItemId(){
return mod_MangMod.alienflesh.shiftedIndex;
}
}
Who told you to name it that? I'm pretty sure TechGuy's tutorials said to keep anything to do with a single mod to only one file prefixed with "mod_". mod_AlienBiome can be condensed to 2 lines of code and added to your mod_MangMod class. (see spoiler)
The only thing you need to register your new Biome are these codes:
public static final BiomeGenBase Namehere = (new BiomeGenNamehere(25)).setColor(0xfa9418).setBiomeName("Any Name Here");
A public static final, placed near wherever you place your block/item declarations, and
ModLoader.addBiome(Namehere);
placed under your public void load. (where you register blocks, set textures, that stuff)
When you have it done the other way, ModLoader thinks there's two separate mods.
Hmm, i tried but it didn't work. This is what i have:
package net.minecraft.src; import java.util.Random; public class ItemLastDaysDrug1 extends ItemFood { public ItemLastDaysDrug1(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.resistance.id, 30 * 20, 10));
entityPlayer.addPotionEffect(new PotionEffect(Potion.heal.id, 30 * 20, 1));
entityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 30 * 20, 10));
int i = Random.nextInt(9);
if(i == 5)
{
entityPlayer.addPotionEffect(new PotionEffect(Potion.poison.id, 30 * 20, 0));
}
return itemStack;
}
{
}
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return EnumRarity.epic;
}
}and it says at Random.nextInt(9); "Cannot make a static reference to the non-static method next Int(int) from the type Random"
Sorry but I can't. It would take up a lot of time. This page may help you with reading text files. I haven't done file reading and writing in Java yet so I can't assist with it.
Use this instead:
Keep everything else how it is though.
C based languages and Java are fairly similar. It will certainly help you knowing C#.
together they are powerful beyond imagination."
It didn't do anything at all, even by itself, i put it to a 50% chance of poison and i used a whole stack of stuff and it didn't give me any poison. This is what i got:
package net.minecraft.src; import java.util.Random; public class ItemLastDaysDrug1 extends ItemFood { public ItemLastDaysDrug1(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.resistance.id, 30 * 20, 10));
entityPlayer.addPotionEffect(new PotionEffect(Potion.heal.id, 30 * 20, 1));
entityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 30 * 20, 10));
Random random = new Random();
int i = random.nextInt(5);
if(i == 5)
{
entityPlayer.addPotionEffect(new PotionEffect(Potion.poison.id, 30 * 20, 0));
}
return itemStack;
}
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return EnumRarity.epic;
}
}BTW the rarity thing doesn't work, but it's still in there
And adding that didn't do anything as i said.
i tried that but it gave me a new error
it said i had to remove the 'final' statment for canDropItself in BlockPaneMod. when i did that and ran the program it gave me this error when i tried to open the world. i started a new world, everthing was fine til i placed the block, then it gave me the same error message.
Mods loaded: 2
ModLoader 1.2.5
mod_electricfence Electric Fence V1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT ea3da9d --------
Generated 6/23/12 11:11 AM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_01, Oracle Corporation
VM: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: AMD Radeonâ„¢ HD 6520G version 4.1.11159 Compatibility Profile Context, ATI Technologies Inc.
java.lang.ClassCastException: net.minecraft.src.BlockElectricFence cannot be cast to net.minecraft.src.BlockPane
at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:399)
at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:226)
at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1450)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1107)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b1b8a9ec ----------
Question 2: You said for .setLightValue that the higher a number, the brighter it is. At brightness level (1F) it was about the brightness of glowstone. The brighter I made it, the darker it got. (I wanted glowbrick to be brighter than glowstone)
Question 3: Is there a way to make mining speeds faster? (1F) was the speed of brick and I want some blocks to be slower than 1F. Higher numbers are even slower.
Question 4: You know how some blocks share data values? Like they have the id, a colon, and then another number on the other side of the colon. (Like half slabs) How do you do that? I have a bunch of bricks that are exactly the same, but just a different texture and crafting recipe.
Question 5: How do you change the sound of a block? I have a block with glass material that still makes a stone sound.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummod_MangMod
package net.minecraft.src; import java.util.Map; import net.minecraft.client.Minecraft; import java.util.List; public class mod_MangMod extends BaseMod { public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F); 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 aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F); public static final Block alienplank = new alienplank(127, 0).setBlockName("alienplank").setHardness(2F).setResistance(5F); public static final Block aliencob = new aliencob(128, 0).setBlockName("aliencob").setHardness(2F).setResistance(10F); public static final Block alienore = new alienore(129, 0).setBlockName("alienore").setHardness(3F).setResistance(5F); public static final Block alienlog = new alienlog(130, 0).setBlockName("alienlog").setHardness(2F).setResistance(5F); public static int alienlogbottom = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog1.png"); public static int alienlogtop = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog2.png"); public static int alienlogside = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog3.png"); public static final Block alienleaf = new alienleaf(131, 0).setBlockName("alienleaf").setHardness(2F); public static final Item cactusjuice = new cactusjuice(5000, 5, 2F, false).setItemName("cactusjuice"); public static final Item applejuice = new ItemFood(5001, 9, 2F, false).setItemName("applejuice"); public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut"); public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut"); public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket"); public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange"); public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon"); public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich"); public static final Item tinyalien = new tinyalien(5008).setItemName("tinyalien"); public static final Item tinysteve = new tinysteve(5009).setItemName("tinysteve"); public static final Item tinyzombie = new tinyzombie(5010).setItemName("tinyzombie"); public static final Item alienflesh = new Item(5011).setItemName("alienflesh"); public static final Item lemon = new lemon(5012).setItemName("lemon"); public static final Item actweegee = new actweegee(5013).setItemName("actweegee"); public static final Item ivspawner = new ivspawner(5014).setItemName("ivspawner"); 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 }); ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(alienruffian.class, 40, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { mod_AlienBiome.alienbiome }); ModLoader.registerEntityID(alienarcher.class, "alienarcher", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(alienarcher.class, 40, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { mod_AlienBiome.alienbiome }); ModLoader.registerEntityID(tinyzombie2.class, "Tiny Zombie", ModLoader.getUniqueEntityId()); ModLoader.registerEntityID(actweegee2.class, "actweegee2", ModLoader.getUniqueEntityId()); ModLoader.registerBlock(aliengrass); ModLoader.addName(aliengrass, "Alien Grass"); aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png"); ModLoader.registerBlock(aliendirt); ModLoader.addName(aliendirt, "Alien Dirt"); alienplank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienplank.png"); ModLoader.registerBlock(alienplank); ModLoader.addName(alienplank, "Alien Plank"); aliencob.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliencob.png"); ModLoader.registerBlock(aliencob); ModLoader.addName(aliencob, "Alien Cobblestone"); alienore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienore.png"); ModLoader.registerBlock(alienore); ModLoader.addName(alienore, "Uralium Ore"); ModLoader.registerBlock(alienlog); ModLoader.addName(alienlog, "Alien Log"); alienleaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienleaf.png"); ModLoader.registerBlock(alienleaf); ModLoader.addName(alienleaf, "Alien Leaves"); cactusjuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/cactusjuice.png"); ModLoader.addName(cactusjuice, "Cactus Juice"); ModLoader.addRecipe(new ItemStack(cactusjuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Block.cactus, Character.valueOf('%'), Item.glassBottle}); 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('%'), Item.glassBottle}); 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"); bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png"); ModLoader.addName(bacon, "Bacon"); ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1)); eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png"); ModLoader.addName(eggsandwich, "Egg Sandwich"); ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg}); tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png"); ModLoader.addName(tinyalien, "Tiny Alien"); ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond}); tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png"); ModLoader.addName(tinyzombie, "Tiny Zombie"); ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond}); tinysteve.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinysteve.png"); ModLoader.addName(tinysteve, "Tiny Steve"); ModLoader.addRecipe(new ItemStack(tinysteve, 1), new Object [] {"#", "%", Character.valueOf('#'), Block.cake, Character.valueOf('%'), tinysteve}); alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png"); ModLoader.addName(alienflesh, "Alien Flesh"); lemon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/lemon.png"); ModLoader.addName(lemon, "Lemon"); actweegee.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/weegeeicon.png"); ModLoader.addName(actweegee, "Weegeemang Action Figure"); ModLoader.addRecipe(new ItemStack(actweegee, 1), new Object [] {"###", "#%#", "$$$", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('%'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('$'), new ItemStack(Block.cloth, 1, 0)}); ivspawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/ivspawner.png"); ModLoader.addName(ivspawner, "Innocent Villager"); } public void addRenderer(Map map) { map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(tinyzombie2.class, new RenderBiped(new ModelZombie(), 0.5F)); map.put(alienruffian.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(alienarcher.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(actweegee2.class, new RenderBiped(new ModelBiped(), 0.5F)); } public String getVersion() { return "1.2.5"; } }cactusjuice
package net.minecraft.src; public class cactusjuice extends ItemFood { public cactusjuice(int i, int j, boolean
{
super(i, j, B);
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
return new ItemStack(Item.glassBottle);
}
}Ok so questions 1, 3 and 5 are answered. For question 2 doing 2.0F still made it darker than 1F. Anyone know the answer to questions 2 and 4?
First, you could make 2 seperate class files.
if you just want to change the code make it look like this:
package net.minecraft.src; import java.util.List; public class mod_file extends BaseMod { public static final Item item = new Item(140).setItemName("Item"); public static final Block block = new Block(141, Material.wood)setHardness(1.0F).setResistance(3.0F).setBlockName("Block"); public void load() { ModLoader.addName(item,"item"); ModLoader.addName(block,"block"); } public String getVersion(); { return "1.2.5"; } }look at the top of the error, it's pretty obvious, you have duplicate load, and getversion methods, you can only have one per that file.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumthe code I use is this: (note the folder keeping my images is called textures)
//overrides bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/bacon.png"); baconRaw.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/baconRaw.png"); oreFood.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Mineral Food.png"); blockRedstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Redstone Block.png"); Nerfite.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Nerfite.png"); NerfiteOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Nerfite Ore.png"); PigManEgg.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/PigManEgg.png"); blockCoal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/Coal Block.png"); NerfiteBar.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Nerfite Bar.png");Try changing the 0 in the poison line to something like 6. I know I said in the tutorial that you could leave it as zero but try changing it.
It is probably being caused by RenderBlocks being told that your block class is an instance of BlockPane when it isn't. RenderBlocks is told that in the getRenderType() method. Depending on what number is returned, a different render type is used. Try making your block class extend BlockPane. If it doesn't work then you may have to wait until I can figure it out and make a tutorial on it.
Remove the 2F from the public static final line of the food.
I'll get to it when I get to it. Asking for it only makes me want to do it less.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThanks
together they are powerful beyond imagination."
Look at BlockPumpkin. It shows several examples of how to do it.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummod_MangMod
package net.minecraft.src; import java.util.Map; import net.minecraft.client.Minecraft; import java.util.List; public class mod_MangMod extends BaseMod { public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F); 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 aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F); public static final Block alienplank = new alienplank(127, 0).setBlockName("alienplank").setHardness(2F).setResistance(5F); public static final Block aliencob = new aliencob(128, 0).setBlockName("aliencob").setHardness(2F).setResistance(10F); public static final Block alienore = new alienore(129, 0).setBlockName("alienore").setHardness(3F).setResistance(5F); public static final Block alienlog = new alienlog(130, 0).setBlockName("alienlog").setHardness(2F).setResistance(5F); public static int alienlogbottom = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog1.png"); public static int alienlogtop = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog2.png"); public static int alienlogside = ModLoader.addOverride("/terrain.png", "/mangmod/alienlog3.png"); public static final Block alienleaf = new alienleaf(131, 0).setBlockName("alienleaf").setHardness(0.2F); public static final Block alienstone = new alienleaf(132, 0).setBlockName("alienstone").setHardness(1.5F).setResistance(10F); public static final Item cactusjuice = new cactusjuice(5000, 5, false).setItemName("cactusjuice"); public static final Item applejuice = new applejuice(5001, 9, false).setItemName("applejuice"); public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut"); public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut"); public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket"); public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange"); public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon"); public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich"); public static final Item tinyalien = new tinyalien(5008).setItemName("tinyalien"); public static final Item tinysteve = new tinysteve(5009).setItemName("tinysteve"); public static final Item tinyzombie = new tinyzombie(5010).setItemName("tinyzombie"); public static final Item alienflesh = new Item(5011).setItemName("alienflesh"); public static final Item lemon = new lemon(5012).setItemName("lemon"); public static final Item actweegee = new actweegee(5013).setItemName("actweegee"); public static final Item ivspawner = new ivspawner(5014).setItemName("ivspawner"); 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 }); ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(alienruffian.class, 70, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { mod_AlienBiome.alienbiome }); ModLoader.registerEntityID(alienarcher.class, "alienarcher", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(alienarcher.class, 70, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { mod_AlienBiome.alienbiome }); ModLoader.registerEntityID(tinyzombie2.class, "Tiny Zombie", ModLoader.getUniqueEntityId()); ModLoader.registerEntityID(actweegee2.class, "actweegee2", ModLoader.getUniqueEntityId()); ModLoader.registerBlock(aliengrass); ModLoader.addName(aliengrass, "Alien Grass"); aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png"); ModLoader.registerBlock(aliendirt); ModLoader.addName(aliendirt, "Alien Dirt"); alienplank.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienplank.png"); ModLoader.registerBlock(alienplank); ModLoader.addName(alienplank, "Alien Plank"); aliencob.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliencob.png"); ModLoader.registerBlock(aliencob); ModLoader.addName(aliencob, "Alien Cobblestone"); alienore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienore.png"); ModLoader.registerBlock(alienore); ModLoader.addName(alienore, "Uralium Ore"); ModLoader.registerBlock(alienlog); ModLoader.addName(alienlog, "Alien Log"); alienleaf.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienleaf.png"); ModLoader.registerBlock(alienleaf); ModLoader.addName(alienleaf, "Alien Leaves"); alienstone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/alienstone.png"); ModLoader.registerBlock(alienstone); ModLoader.addName(alienstone, "Alien Stone"); cactusjuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/cactusjuice.png"); ModLoader.addName(cactusjuice, "Cactus Juice"); ModLoader.addRecipe(new ItemStack(cactusjuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Block.cactus, Character.valueOf('%'), Item.glassBottle}); 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('%'), Item.glassBottle}); 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"); bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png"); ModLoader.addName(bacon, "Bacon"); ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1)); eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png"); ModLoader.addName(eggsandwich, "Egg Sandwich"); ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg}); tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png"); ModLoader.addName(tinyalien, "Tiny Alien"); ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond}); tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png"); ModLoader.addName(tinyzombie, "Tiny Zombie"); ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond}); tinysteve.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinysteve.png"); ModLoader.addName(tinysteve, "Tiny Steve"); ModLoader.addRecipe(new ItemStack(tinysteve, 1), new Object [] {"#", "%", Character.valueOf('#'), Block.cake, Character.valueOf('%'), tinysteve}); alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png"); ModLoader.addName(alienflesh, "Alien Flesh"); lemon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/lemon.png"); ModLoader.addName(lemon, "Lemon"); actweegee.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/weegeeicon.png"); ModLoader.addName(actweegee, "Weegeemang Action Figure"); ModLoader.addRecipe(new ItemStack(actweegee, 1), new Object [] {"###", "#%#", "$$$", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('%'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('$'), new ItemStack(Block.cloth, 1, 0)}); ivspawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/ivspawner.png"); ModLoader.addName(ivspawner, "Innocent Villager"); } public void addRenderer(Map map) { map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(tinyzombie2.class, new RenderBiped(new ModelZombie(), 0.5F)); map.put(alienruffian.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(alienarcher.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(actweegee2.class, new RenderBiped(new ModelBiped(), 0.5F)); map.put(lemon2.class, new RenderSnowball(lemon.iconIndex)); } public String getVersion() { return "1.2.5"; } }mod_AlienBiome (was told to name it this)
package net.minecraft.src; public class mod_AlienBiome extends BaseMod { public static final BiomeGenBase alienbiome = (new alienbiome(25)).setColor(0x000000).setBiomeName("alienbiome"); public void load() { ModLoader.addBiome(alienbiome); } @Override public String getVersion() { // TODO Auto-generated method stub return "1.2.5"; } }alienbiome
package net.minecraft.src; import java.util.List; import java.util.Random; public class alienbiome extends BiomeGenBase { public alienbiome(int par1) { super(par1); spawnableCreatureList.clear(); topBlock = (byte)mod_MangMod.aliengrass.blockID; fillerBlock = (byte)mod_MangMod.aliendirt.blockID; } }alienarcher
package net.minecraft.src; import java.util.Random; public class alienarcher extends EntityMob { public alienarcher(World world) { super(world); texture = "/mangmod/alienarcher.png"; moveSpeed = 0.3F; attackStrength = 5; tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 1, 60)); tasks.addTask(3, new EntityAIWander(this, moveSpeed)); tasks.addTask(4, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F)); tasks.addTask(4, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true)); } public boolean isAIEnabled() { return true; } public int getMaxHealth() { return 20; } protected String getLivingSound() { return "mob.villager.default"; } protected String getHurtSound() { return "mob.villager.defaulthurt"; } protected String getDeathSound() { return "mob.zombiedeath"; } protected boolean canDespawn() { return false; } protected int getDropItemId(){ return mod_MangMod.alienflesh.shiftedIndex; } public ItemStack getHeldItem() { return defaultHeldItem; } static { defaultHeldItem = new ItemStack(Item.bow, 1); } private static final ItemStack defaultHeldItem; }alienruffian
package net.minecraft.src; import java.util.Random; public class alienruffian extends EntityMob { public alienruffian(World world) { super(world); texture = "/mangmod/alienruffian.png"; moveSpeed = 0.8F; attackStrength = 4; tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(1, new EntityAIWander(this, moveSpeed)); tasks.addTask(2, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F)); tasks.addTask(3, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true)); } public int getMaxHealth() { return 20; } protected String getLivingSound() { return "mob.villager.default"; } protected String getHurtSound() { return "mob.villager.defaulthurt"; } protected String getDeathSound() { return "mob.zombiedeath"; } protected boolean canDespawn() { return false; } protected int getDropItemId(){ return mod_MangMod.alienflesh.shiftedIndex; } }-
View User Profile
-
View Posts
-
Send Message
Retired StaffWho told you to name it that? I'm pretty sure TechGuy's tutorials said to keep anything to do with a single mod to only one file prefixed with "mod_". mod_AlienBiome can be condensed to 2 lines of code and added to your mod_MangMod class. (see spoiler)
The only thing you need to register your new Biome are these codes:
public static final BiomeGenBase Namehere = (new BiomeGenNamehere(25)).setColor(0xfa9418).setBiomeName("Any Name Here");A public static final, placed near wherever you place your block/item declarations, andplaced under your public void load. (where you register blocks, set textures, that stuff)
When you have it done the other way, ModLoader thinks there's two separate mods.