One Problem, though.
For my plant (which I got from another tutorial), it tells me that the setTickOnLoad(true); boolen function isn't found, and it wants me to add one. What do I do? Here's my code, along with the mod file:
//BlockTomato.java
package net.minecraft.src;
import java.util.Random;
public class BlockTomato extends Block
{
public int topID;
public int sideBottomID;
protected BlockTomato(int i, int j, int m, int n)
{
super(i, Material.plants);
blockIndexInTexture = j;
float f = 0.375F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
setTickOnLoad(true);
topID = m;
sideBottomID = n;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.isAirBlock(i, j + 1, k))
{
int l;
for(l = 1; world.getBlockId(i, j - l, k) == blockID; l++) { }
if(l < 3)
{
int i1 = world.getBlockMetadata(i, j, k);
if(i1 == 15)
{
world.setBlockWithNotify(i, j + 1, k, blockID);
world.setBlockMetadataWithNotify(i, j, k, 0);
} else
{
world.setBlockMetadataWithNotify(i, j, k, i1 + 1);
}
}
}
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
int l = world.getBlockId(i, j - 1, k);
if(l == blockID)
{
return true;
}
return l == Block.grass.blockID || l == Block.dirt.blockID || l == Block.tilledField.blockID || l == Block.sand.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
checkBlockCoordValid(world, i, j, k);
}
protected final void checkBlockCoordValid(World world, int i, int j, int k)
{
if(!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return canPlaceBlockAt(world, i, j, k);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public int idDropped(int i, Random random, int j)
{
return mod_Tomato.iTomato.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 4;
}
public int getBlockTextureFromSide(int i)
{
if (i == 1)
{
return mod_Tomato.topID;
}
else
{
return mod_Tomato.sideBottomID;
}
}
}
//mod_Tomato.java
package net.minecraft.src;
import java.util.Random;
public class mod_Tomato extends BaseMod
{
public static final Block bTomato = new BlockTomato(127,0,0,0).setHardness(0.5F).setResistance(1F).setBlockName("tomatoBlock");
public static final Item iTomato = new ItemFood(397, 4, false).setItemName("tomatoFood");
public static int topID;
public static int sideBottomID;
public mod_Tomato()
{
ModLoader.registerBlock(bTomato);
How do I make my custom mob hold an Item like a Diamond Sword?
Add this to your entity code
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.swordStone, 1);
}
private static final ItemStack defaultHeldItem;
Just change Item.swordStone to a diamond sword.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Please help! I'm trying to make a minecraft 1.2.3 mod but got errors!
(Mod_BedStone.java)
package net.minecraft.src;
public class mod_BedStone extends BaseMod
{
public static final Block BedStone = new BedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
BedStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BedStone/image.png");
ModLoader.registerBlock(BedStone);
ModLoader.addName(BedStone, "BedStone");
ModLoader.addRecipe(new ItemStack(BedStone, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
public class BlockBedStone extends Block
{
public BlockBedStone(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return Item.bed.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}}
My errors are: 1. Bedstone cannot be resolved to a type
2.Project 'Server' is missing required library: 'jars/minecraft_server.jar'
3.The project cannot be built until build path errors are resolved
4. The public type BlockBedStone must be defined in its own file
Warnings:
1.Build path specifies execution environment javase-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment
Alright so I followed the tutorial for a custom mob. I made a slime with everything copied from slimes (render and model are both normal), exept I made it so it could only spawn in the jungle. (ocelots "GetCanSpawnHere") The model didnt work or it may have been the render because this snippet of code... " map.put(EntityJungleSlime.class, new RenderJungleSlime(new ModelJungleSlime(), 0.5F));" didnt work, as it says in eclipse... "ModelJungleSlime() is undefined" and when I "quick fix" it set a null. And you know what those do.
Alright so I followed the tutorial for a custom mob. I made a slime with everything copied from slimes (render and model are both normal), exept I made it so it could only spawn in the jungle. (ocelots "GetCanSpawnHere") The model didnt work or it may have been the render because this snippet of code... " map.put(EntityJungleSlime.class, new RenderJungleSlime(new ModelJungleSlime(), 0.5F));" didnt work, as it says in eclipse... "ModelJungleSlime() is undefined" and when I "quick fix" it set a null. And you know what those do.
tested a bit more, and well, still didnt work. infact I messed it up even worse. So I guess for now ill be working on other stuff.
Please help! I'm trying to make a minecraft 1.2.3 mod but got errors!
(Mod_BedStone.java)
package net.minecraft.src;
public class mod_BedStone extends BaseMod
{
public static final Block BedStone = new BedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
BedStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BedStone/image.png");
ModLoader.registerBlock(BedStone);
ModLoader.addName(BedStone, "BedStone");
ModLoader.addRecipe(new ItemStack(BedStone, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
public class BlockBedStone extends Block
{
public BlockBedStone(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return Item.bed.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}}
My errors are: 1. Bedstone cannot be resolved to a type
2.Project 'Server' is missing required library: 'jars/minecraft_server.jar'
3.The project cannot be built until build path errors are resolved
4. The public type BlockBedStone must be defined in its own file
Warnings:
1.Build path specifies execution environment javase-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment
Please Help!
You aren't calling your block class. Make it so that it says this:
public static final Block BedStone = new BlockBedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);
That should fix both errors relating to bedstone. You don't need to worry about the rest of the errors.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Everything's working except for putting the mod in a .zip file. If I put it in the mods directory as an uncompressed folder, ModLoader runs it fine, but I have tried using 7-zip to make a .zip file and I have also tried the Windows 7 "send to compressed file" to make a .zip file, and neither loads from the mods folder. I get no errors: It just is ignored. Minecraft version 1.1.
Everything's working except for putting the mod in a .zip file. If I put it in the mods directory as an uncompressed folder, ModLoader runs it fine, but I have tried using 7-zip to make a .zip file and I have also tried the Windows 7 "send to compressed file" to make a .zip file, and neither loads from the mods folder. I get no errors: It just is ignored. Minecraft version 1.1.
It shouldn't make a difference, but I uses WinRAR and it works fine.
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 gave you like 3 new messages... it said you've read it the last time at 2 march... You said you'd send it to me "tonight or tomorrow". I know i sounded a bit greedy and stuff... but you said that... and i haven't gained it so i was wondering where it was... and how far you were... i also said whut the tutorial should include...
Tech can you make the Potions tut in the first place? I kinda need it...
And i remember that only month ago you had something like 400 posts xD you tripled it
Whatever i do i canot get my ore i made spawning... is this because mcp updated or is there something wrong in my script? i dont get errors in the compiler, it just doesnt spawn. here is my code:
package net.minecraft.src;
import java.util.*;
public class mod_Silver extends BaseMod
{
public static final Block Silver = new BlockSilver(160, 0).setBlockName("Silver").setHardness(3F).setResistance(4F).setLightValue(1F);
public static final Item SilverIngot = new Item(161).setItemName("SilverIngot");
public void load()
{
Silver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Mod/silver.png");
SilverIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Mod/SilverIngot.png");
ModLoader.registerBlock(Silver);
ModLoader.addName(Silver, "Silver Ore");
ModLoader.addName(SilverIngot, "Silver Ingot");
ModLoader.addRecipe(new ItemStack(Silver, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
ModLoader.addSmelting(mod_Silver.Silver.blockID, new ItemStack(mod_Silver.SilverIngot, 1));
}
public String getVersion()
{
return "1.2.3";
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(64);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Silver.Silver.blockID, 12)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
}
and my block...
package net.minecraft.src;
import java.util.Random;
public class BlockSilver extends Block
{
public BlockSilver(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Silver.Silver.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
please help me i dont know what to do...
GenerateSurface is now generateSurface
So instead of this:
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
Do this:
public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
it took me forever to find out when i had this problem
Can you make a tut on mob spawners?
cause I'd like to generate a Shop with a spawner of a mob. (Custom Modded mob)
I hope it's the first one to be released (:, I'm sure ever one else would like to see it too!
Can you make a tut on mob spawners?
cause I'd like to generate a Shop with a spawner of a mob. (Custom Modded mob)
I hope it's the first one to be released (:, I'm sure ever one else would like to see it too!
thanks,
-lolydodo123.
I want to make a mod that adds the soul reaver history,and i want to add some structures to my mobs spawn inside
can you make a more detailed and simple way for making mobs with custom shape, and please give examples with pic's show diferent mob shapes. Thank You!
Thanks So much! But when I did that i saw random errors and i saw that my code wasn't the same as the template shows so i fixed it up a little. But now i only have one problem related to the block which is better than before! If you can help than THANKS!
public class BlockBedStone extends Block <[Error] one thats wrong.
{
public BlockBedStone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return Item.bed.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}}
errors: 1.Project 'Server' is missing required library: 'jars/minecraft_server.jar'
2.The project cannot be built until build path errors are resolved.
Important error:1.The public type BlockBedStone must be defined in its own file
Just in case you want to see what i did to the "mod_BedStone.java"
mod_BedStone.java
package net.minecraft.src;
public class mod_BedStone extends BaseMod
{
public static final Block BedStone = new BlockBedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
BedStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BedStone/image.png");
ModLoader.registerBlock(BedStone);
ModLoader.addName(BedStone, "BedStone");
ModLoader.addRecipe(new ItemStack(BedStone, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 802da9bc --------
Generated 10/03/12 6:12 PM
Minecraft: Minecraft 1.2.3
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_03, Oracle Corporation
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce GT 540M/PCI/SSE2 version 4.1.0, NVIDIA Corporation
java.lang.StringIndexOutOfBoundsException: String index out of range: 7
at java.lang.String.charAt(Unknown Source)
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:382)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:409)
at net.minecraft.src.mod_CheesTools.load(mod_CheesTools.java:25)
at net.minecraft.src.ModLoader.init(ModLoader.java:853)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:154)
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:423)
at net.minecraft.client.Minecraft.run(Minecraft.java:784)
at java.lang.Thread.run(Unknown Source)
----- END ERROR REPORT cdf5299f ----------
My Code
package net.minecraft.src;
public class mod_CheesTools extends BaseMod
{
public static final Item CheesPickaxe = new ItemPickaxe(4005, EnumToolMaterial.EMERALD).setItemName("CheesPickaxe");
public static final Item CheesSpade = new ItemSpade(4006, EnumToolMaterial.EMERALD).setItemName("CheesSpade");
public static final Item CheesAxe = new ItemAxe(4007, EnumToolMaterial.EMERALD).setItemName("CheesAxe");
public static final Item CheesHoe = new ItemHoe(4008, EnumToolMaterial.EMERALD).setItemName("CheesHoe");
public static final Item CheesSword = new ItemSword(4009, EnumToolMaterial.EMERALD).setItemName("CheesSword");
public String getVersion()
{
return "1.2.3";
}
public mod_CheesTools ()
{
}
public void load()
{
//Pick
ModLoader.addName(CheesPickaxe, "Chees Pickaxe");
CheesPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Chees/CheesPickaxe.png");
ModLoader.addRecipe(new ItemStack(CheesPickaxe, 1), new Object[]
{
"o", " o ", "xxx", Character.valueOf('x'), Item.stick , Character.valueOf('o'), Block.dirt
});
//Spade
ModLoader.addName(CheesSpade, "Chees Spade");
CheesSpade.iconIndex = ModLoader.addOverride("/gui/items.png", "/Chees/CheesSpade.png");
ModLoader.addRecipe(new ItemStack(CheesSpade, 1), new Object[]
{
" o ", " o ", " x ", Character.valueOf('x'), Item.stick, Character.valueOf('o'), Block.dirt
});
//Axe
ModLoader.addName(CheesAxe, "Chees Axe");
CheesAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Chees/CheesAxe.png");
ModLoader.addRecipe(new ItemStack(CheesAxe, 1), new Object[]
{
" o ", " ox", " xx", Character.valueOf('x'), Item.stick, Character.valueOf('o'), Block.dirt
});
//Hoe
ModLoader.addName(CheesHoe, "Chees Hoe");
CheesHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Chees/CheesHoe.png");
ModLoader.addRecipe(new ItemStack(CheesHoe, 1), new Object[]
{
" xx", " o ", " o ", Character.valueOf('x'), Item.stick, Character.valueOf('o'), Block.dirt
});
//Sword
ModLoader.addName(CheesSword, "Cheese Sword");
CheesSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/Chees/CheesSword.png");
ModLoader.addRecipe(new ItemStack(CheesSword, 1), new Object[]
{
" o ", " x ", " x ", Character.valueOf('x'), Item.stick, Character.valueOf('o'), Block.dirt
});
}
Help This Is The Error I Get, Can Someone Help Me??
My Code
In the pickaxe recipe, you need to add extra spaces to the first set of " ".
ModLoader.addRecipe(new ItemStack(CheesPickaxe, 1), new Object[]
{
" o ", " o ", "xxx", Character.valueOf('x'), Item.stick , Character.valueOf('o'), Block.dirt
});
@Everyone asking questions to whom I haven't replied yet
I'm going to reply to you all, but a lot of people are asking questions and it takes time to help so many people.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
To post a comment, please login or register a new account.
is now
Add this to your entity code
public ItemStack getHeldItem() { return defaultHeldItem; } static { defaultHeldItem = new ItemStack(Item.swordStone, 1); } private static final ItemStack defaultHeldItem;Just change Item.swordStone to a diamond sword.
together they are powerful beyond imagination."
(Mod_BedStone.java)
package net.minecraft.src;
public class mod_BedStone extends BaseMod
{
public static final Block BedStone = new BedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
BedStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BedStone/image.png");
ModLoader.registerBlock(BedStone);
ModLoader.addName(BedStone, "BedStone");
ModLoader.addRecipe(new ItemStack(BedStone, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.3";
}
}
(BedStoneBlock.java)
package net.minecraft.src;
import java.util.Random;
public class BlockBedStone extends Block
{
public BlockBedStone(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return Item.bed.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}}
My errors are: 1. Bedstone cannot be resolved to a type
2.Project 'Server' is missing required library: 'jars/minecraft_server.jar'
3.The project cannot be built until build path errors are resolved
4. The public type BlockBedStone must be defined in its own file
Warnings:
1.Build path specifies execution environment javase-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment
Please Help!
I am
sry for the delay
Art by me: [email protected]
tested a bit more, and well, still didnt work. infact I messed it up even worse. So I guess for now ill be working on other stuff.
You aren't calling your block class. Make it so that it says this:
public static final Block BedStone = new BlockBedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);That should fix both errors relating to bedstone. You don't need to worry about the rest of the errors.
Post your code please.
I'm still working on it. I've been busy.
together they are powerful beyond imagination."
It shouldn't make a difference, but I uses WinRAR and it works fine.
together they are powerful beyond imagination."
Again, sorry if i sounded Greedy and all that.
-IHVD
http://www.minecraftsao.org/
Check it out!
And i remember that only month ago you had something like 400 posts xD you tripled it
I think you are supposed to do
if you take a look at EntityWolf it should tell you how to use it
GenerateSurface is now generateSurface
So instead of this:
Do this:
it took me forever to find out when i had this problem
cause I'd like to generate a Shop with a spawner of a mob. (Custom Modded mob)
I hope it's the first one to be released (:, I'm sure ever one else would like to see it too!
thanks,
-lolydodo123.
I want to make a mod that adds the soul reaver history,and i want to add some structures to my mobs spawn inside
Thank you!!
BedStoneBlock.java
package net.minecraft.src;
import java.util.Random;
public class BlockBedStone extends Block <[Error] one thats wrong.
{
public BlockBedStone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return Item.bed.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 1;
}}
errors: 1.Project 'Server' is missing required library: 'jars/minecraft_server.jar'
2.The project cannot be built until build path errors are resolved.
Important error:1.The public type BlockBedStone must be defined in its own file
Just in case you want to see what i did to the "mod_BedStone.java"
mod_BedStone.java
package net.minecraft.src;
public class mod_BedStone extends BaseMod
{
public static final Block BedStone = new BlockBedStone(250, 0).setBlockName("asdf").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
BedStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BedStone/image.png");
ModLoader.registerBlock(BedStone);
ModLoader.addName(BedStone, "BedStone");
ModLoader.addRecipe(new ItemStack(BedStone, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.3";
}
}
My Code
In the pickaxe recipe, you need to add extra spaces to the first set of " ".
ModLoader.addRecipe(new ItemStack(CheesPickaxe, 1), new Object[] { " o ", " o ", "xxx", Character.valueOf('x'), Item.stick , Character.valueOf('o'), Block.dirt });@Everyone asking questions to whom I haven't replied yet
I'm going to reply to you all, but a lot of people are asking questions and it takes time to help so many people.
together they are powerful beyond imagination."