src\minecraft\net\minecraft\src\mod_OwnTree.java:2: error: <identifier> expected
import java.util.
Do this:
import java.util.*;
-----------------------------------------------
src\minecraft\net\minecraft\src\Blocktacolog.java:3: error: ';' expected
import java.util.Random
Do this:
import java.util.Random;
-----------------------------------------------
And the rest..... well, it seems you forgot to type a few things in...
Rollback Post to RevisionRollBack
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
WOW! These are great and easy to follow tutorials. First off, I am a new modder and I wonder what you recommend me to do for start-up. should I learn a bit of java or maybe I could I get away with learning as I go along. Pardon my ignorance but when I tried to follow the tutorial on how to make a new block, I messed it up and the block will not appear.
DCBaseMod
package net.minecraft.src;
import java.lang.reflect.Method;
import java.util.Random;
public class DCBaseMod extends BaseMod
{
public DCBaseMod()
{
//Registers the Block (You need to put something in between these brackets!)
ModLoader.registerBlock(DCBlockMarble);
ModLoader.addName(DCBlockMarble, "Marble");
//Adds the texture to the block
DCBlockMarble.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Textures/Marble.png");
}
//Creates the blocks and adds its properties (ID, Name, How long it takes to break, Explosion Resistance, glowing value)
public static final Block DCBlockMarble;
static
{
DCBlockMarble = (new DCBlockMarble(250, 0).setBlockName("Marble").setHardness(0F).setResistance(4F));
}
//Mod version (To update the mod, change this to minecraft version )
public String getVersion()
{
return "1.2.5";
}
public void load()
{
ModLoader.addName(DCBlockMarble, "Marble");
ModLoader.addRecipe(new ItemStack (DCBlockMarble, 1), (new Object[] {"RRR", "RRR", "RRR", Character.valueOf('R'), Block.dirt}));
}
}
DCBlockMarble
package net.minecraft.src;
import java.util.*;
public class DCBlockMarble extends Block
{
protected DCBlockMarble (int i, int j)
{
super(i ,j, Material.rock);
}}
If you do not have a lot of time, or you don't wish to that's fine. I just thought the creator of the code would know it best and not anyone on the IRC, so I went here first.
Im thinking this might be because the tree is set to generate only in the desert, but it is only allowed to grow on grass or dirt in the coding. I would try changing the biome or adding sand as a block it can generate on, and then see what happens, but I m getting a few errors as well.
Where does it say that? I'd like to play around with it if I knew where it says that
First off, multiplayerWorld and worldHeight are giving me errors wherever they are and I know you just have to change that to something else, but I'm not sure what to change them too.
Wherever it says "world.multiplayerWorld", put this:
world.isRemote
Also wherever it says "world.worldHeight", put this:
world.getHeight
these are just minor changes that jeb made to the vanilla code.
Also this is just something small, but is there a way to make a multi textured log? Then it wouldn't look like there is bark everywhere.
This is easy to solve. What you do is first make two textures. One for the top and bottom of the log and the other for the bark. Then, you can put those in the texture folder (which is what I usually do) just like any other texture for your mod.
Then, make an integer in your mod_YourMod.java file:
public static int yourLogBottom = ModLoader.addOverride("/terrain.png", "/path/texturefortopandbottom.png");
// This integer will be used twice, because the top and bottom of the log look the same.
public static int yourLogSides = ModLoader.addOverride("/terrain.png", "/path/textureforsides.png");
Then put this in the BlockYourLog.java file:
public int getBlockTextureFromSide(int i)
{
if(i == 0)
{
return mod_YourMod.YourLogBottom;
// I make two of these so that the top and bottom of the log can be contained to one file.
}
else if(i == 1)
{
return mod_YourMod.YourLogBottom;
}
else
{
return mod_YourMod.YourLogSides;
}
}
Basically from what I gather, what this does is create two integers, which are shorthand for the texture overrides. Then what you do in the BlockYourLog.java is tell the game "If i, which is a side of the block, is 0 (which is either the top or the bottom, I am not sure), then set the texture to whatever the variable 'YourLogBottom' is in the class 'mod_YourMod'. Otherwise, if i is equal to 1, then do the same. Otherwise if i is equal to anything else (being the remaining four sides of the block), set their textures to the variable 'YourLogSides' in the class 'mod_YourMod'." This is what worked for me, at least. You can even go as far as to make six different textures and apply them to each individual side of the block, if you want it to be detailed. I just use the two main textures for simplicity because I am adding 27 trees to minecraft with my mod.
Rollback Post to RevisionRollBack
"If you wish make an apple pie from scratch, you must first invent the universe." -- Carl Sagan
Nice challenge for you: Write a tutorial about TileEntity models, if you need help, feel free to ask.
O and it's mayby usefull to make a tutorial on how to setup eclipse. This will reduce the amount of problems with wrong methods and will help to play around with methods because when you type like world. it gives a list of possibilities to use.
I think the reason there isn't many tutorials out there nowadays is because MCP added native eclipse support. I like eclipse, and I'm used to using it, in fact it's what I'm using right now to code my carpentry mod (hence why I'm talking about trees a lot in this thread :P). But my friend tells me that the IDE "NetBeans" is better. I don't know, if I were to make a tutorial on how to set up an IDE I'd do both, just so people have an option, but that's just me.
Rollback Post to RevisionRollBack
"If you wish make an apple pie from scratch, you must first invent the universe." -- Carl Sagan
How do i make a mod that more than 1 block in it with out having seprate mod files Example:
mod_block1
mod_block2
i want a mod_blocks
can you help me please
I've created a new explosion, and it works. The only problem I have is that when my item explodes, the blocks drop (like dirt for example) but the world doesn't render the blocks destroyed unless I reload the world, or leave the chunk area and come back to it. Then everything is fine. How do I set the world to render after the explosion occurs?
Currently, I have a new file called ExplosionCreeper.class that is a near exact copy of Explosion.class with different values for how strong and big the explosion is.
I also created the necessary files in World.class for ExplosionCreeper. So everything is WORKING as far as exploding and damage, its just the world will not render the blocks destroyed automatically, I have to manually reload the world for it to take effect.
I am retiring from Minecraft, but I will still play Xbox-360 Minecraft!
Goodbye, everyone :3
-DM
Rollback Post to RevisionRollBack
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
Just added my Xbox Gamertag. Send me a message sometime! Hahaha.
Anyways, thanks for all of your guy's views. I am now completely done with Minecraft Forums, Minecraft PC, and modding. I may come on occasionally, but that will be it.
Again, thanks for all of the views, and thanks to senpaisubaraki for taking over!
-Alex
Rollback Post to RevisionRollBack
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
Alright, if anyone can fix these errors(They are errors I have never seen before), they are a boss and they get the pre-release of the MoreFun mod I am making:
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/BlockTrampoline.java:8: cannot find symbol
symbol : constructor Block()
location: class net.minecraft.src.Block
{
^
src/minecraft/net/minecraft/src/BlockTrampoline.java:17: incompatible types
found : java.lang.String
required: int
return "morefun/trampoline.png";
^
src/minecraft/net/minecraft/src/ItemGrenade.java:20: cannot find symbol
symbol : method entityJoinedWorld(net.minecraft.src.EntityGrenade)
location: class net.minecraft.src.World
world.entityJoinedWorld(new EntityGrenade(world, entityplayer));
^
src/minecraft/net/minecraft/src/mod_FunMain.java:29: cannot find symbol
symbol : constructor BlockTrampoline(int,int)
location: class net.minecraft.src.BlockTrampoline
BlockTrampoline = (new BlockTrampoline(249, 0).setBlockName("More Fun: Trampoline").setHardness(2F).setResistance(0F).setLightValue(1F));
^
src/minecraft/net/minecraft/src/mod_FunMain.java:39: cannot find symbol
symbol : constructor ItemStack(int,int)
location: class net.minecraft.src.ItemStack
ModLoader.addRecipe(new ItemStack (mod_FunMain.BlockTrampoline.blockID, 2), (new Object[] {" ", "SWS", "III", Character.valueOf('S'), mod_FunMain.ItemSpring.shiftedIndex, Character.valueOf('W'), Block.cloth, Character.valueOf('I'), Item.ingotIron.shiftedIndex}));
^
src/minecraft/net/minecraft/src/EntityGrenade.java:94: cannot find symbol
symbol : method attackEntityFrom(net.minecraft.src.Entity,int)
location: class net.minecraft.src.EntityItem
super.attackEntityFrom(entity, i);
^
6 errors
==================
most of these are just typing errors, like it should be /morefun/trampoline.png,
he needs { in a few places, other minor spelling and character issues
I tried the tree tutorial and I fixed all but one error.
Part of the code:
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX,
chunkZ);
WorldGenTest worldgentutorial = new WorldGenTest();
if (biome instanceof BiomeGenDesert) {
for (int x = 0; x < 1; x++) {
int Xcoord = chunkX + randomGenerator.nextInt(16);
int Zcoord = chunkZ + randomGenerator.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, random, Xcoord, i, Zcoord);
}
}
And it says that "tree" cannot be resolved. Any help please?
here's what i put (it works)
public void generateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 2; ++var5)
{
var6 = var3 + var2.nextInt(16) + 8;
var7 = var2.nextInt(128);
var8 = var4 + var2.nextInt(16) + 8;
(new WorldGenFlowers(mod_DragonBallZ.SenzuFlower.blockID)).generate(var1, var2, var6, var7, var8);
}
BiomeGenBase biome = var1.getWorldChunkManager().getBiomeGenAt(var3, var4);
WorldGenNamekTree tree = new WorldGenNamekTree();
if((biome instanceof BiomeGenNamek))
{
for(int x = 0;x<5;x++)
{
int k = var3 + var2.nextInt(16) + 8;
int l = var4 + var2.nextInt(16) + 8;
int i1 = var1.getHeightValue(k, l);
tree.generate(var1, var2, k, i1, l);
}
}
}
igonre the part in green
i believe the 16's determine the average height
Your errors say this needs to be done:
DCBaseMod
DCBlockMarble
If you do not have a lot of time, or you don't wish to that's fine. I just thought the creator of the code would know it best and not anyone on the IRC, so I went here first.
Where does it say that? I'd like to play around with it if I knew where it says that
Wherever it says "world.multiplayerWorld", put this:
Also wherever it says "world.worldHeight", put this:
these are just minor changes that jeb made to the vanilla code.
I am not sure how you have it set up, but here is my leaf.java file (at least the areas where setTickOnLoad pops up):
I'm not entirely sure what it's supposed to do, but that's how it is in my code and it works.
Code & error, please?
This is easy to solve. What you do is first make two textures. One for the top and bottom of the log and the other for the bark. Then, you can put those in the texture folder (which is what I usually do) just like any other texture for your mod.
Then, make an integer in your mod_YourMod.java file:
Then put this in the BlockYourLog.java file:
Basically from what I gather, what this does is create two integers, which are shorthand for the texture overrides. Then what you do in the BlockYourLog.java is tell the game "If i, which is a side of the block, is 0 (which is either the top or the bottom, I am not sure), then set the texture to whatever the variable 'YourLogBottom' is in the class 'mod_YourMod'. Otherwise, if i is equal to 1, then do the same. Otherwise if i is equal to anything else (being the remaining four sides of the block), set their textures to the variable 'YourLogSides' in the class 'mod_YourMod'." This is what worked for me, at least. You can even go as far as to make six different textures and apply them to each individual side of the block, if you want it to be detailed. I just use the two main textures for simplicity because I am adding 27 trees to minecraft with my mod.
I think the reason there isn't many tutorials out there nowadays is because MCP added native eclipse support. I like eclipse, and I'm used to using it, in fact it's what I'm using right now to code my carpentry mod (hence why I'm talking about trees a lot in this thread :P). But my friend tells me that the IDE "NetBeans" is better. I don't know, if I were to make a tutorial on how to set up an IDE I'd do both, just so people have an option, but that's just me.
mod_block1
mod_block2
i want a mod_blocks
can you help me please
Currently, I have a new file called ExplosionCreeper.class that is a near exact copy of Explosion.class with different values for how strong and big the explosion is.
I also created the necessary files in World.class for ExplosionCreeper. So everything is WORKING as far as exploding and damage, its just the world will not render the blocks destroyed automatically, I have to manually reload the world for it to take effect.
If anyone wants to port/remake this, feel free to do that! Or don't. It's up to you, really.
Just added my Xbox Gamertag. Send me a message sometime! Hahaha.
Anyways, thanks for all of your guy's views. I am now completely done with Minecraft Forums, Minecraft PC, and modding. I may come on occasionally, but that will be it.
Again, thanks for all of the views, and thanks to senpaisubaraki for taking over!
-Alex
most of these are just typing errors, like it should be /morefun/trampoline.png,
he needs { in a few places, other minor spelling and character issues
here's what i put (it works)
public void generateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 2; ++var5)
{
var6 = var3 + var2.nextInt(16) + 8;
var7 = var2.nextInt(128);
var8 = var4 + var2.nextInt(16) + 8;
(new WorldGenFlowers(mod_DragonBallZ.SenzuFlower.blockID)).generate(var1, var2, var6, var7, var8);
}
BiomeGenBase biome = var1.getWorldChunkManager().getBiomeGenAt(var3, var4);
WorldGenNamekTree tree = new WorldGenNamekTree();
if((biome instanceof BiomeGenNamek))
{
for(int x = 0;x<5;x++)
{
int k = var3 + var2.nextInt(16) + 8;
int l = var4 + var2.nextInt(16) + 8;
int i1 = var1.getHeightValue(k, l);
tree.generate(var1, var2, k, i1, l);
}
}
}
igonre the part in green
i believe the 16's determine the average height