I'm sorry if this is the wrong section... This feels the most fitting
I would like to learn how to code in Java but I don't know where to start...
I wan't to start as low as you can start as I'm quite inexperienced but I have created a few applications in VB.
NOTE: This definatly works on MC1.3 on Windows.
Well, there are many ways of doing this. Firstly I suggest you get Minecraft Coder Pack, available here. Then do what it says in the README-MCP.txt file and you're good to go. Remeber that you need to add java and javac to your PATH environment variable. It says how to do that in the README-MCP.txt file.
I suggest you start off with something small, like a new block.
Yeah, this is a tutorial on it now. Lol.
1A. Navigate to the MCP folder that you saved MCP in. Go to [MCP FOLDER HERE]\sources\minecraft\net\minecraft\src. Open something like Notepad++ or another syntax text editor and put this code in it:
package net.minecraft.src;
import java.util.Random;
public class BlockNewExample extends Block
{
public BlockNewExample(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random)
{
return 0;
}
}
1b. Save your file as BlockExample.java. Simple eh? But what does it mean? WHAT THE CODE MEANS!
package net.minecraft.src;
import java.util.Random;
These two lines matter not one bit. You'll notice them in most, if not all .java files!
public class BlockNewExample extends Block
'public' is saying that other .java files can use this code and build 'off of it'. 'class BlockNewExample extends Block' is saying "Hey, use that code over there and build off of it, my little .java file!"
public BlockNewExample(int i, int j)
{
super(i, j, Material.rock);
}
I don't actually know what any of that means, sorry. I do know you don't need to edit it to do anything.(I think)
public int idDropped(int i, Random random)
{
return 0;
}
The end part is what you're interested in. This is saying, 'Hey, when you break this, I'll give you something!'. Right now it is 'return 0' so it will give you nothing. But if you change
'public int idDropped(int i, Random random)
{
return 0;
}'
to
'public int idDropped(int i, Random random)
{
return Block.wood.blockID;
}
public int quantityDropped(Random random)
{
return 10;
}'
you can make it so that when you break it it gives you 10 Logs! Awesome.
If you want anything else ask plz :biggrin.gif:
Very informative! Thank you! Can't wait to see what I can do :smile.gif:.
1) Prepare the files:
- Copy the "minecraft_server.jar" file into the "jars" folder.
- Copy the folders "bin" and "resources" from your "%APPDATA$\.minecraft" folder into the "jars" folder.
Where is the minecraft_server.jar file? Is it just my ordinary minecraft.jar?
I don't want to mess this up :sad.gif:.
1) Prepare the files:
- Copy the "minecraft_server.jar" file into the "jars" folder.
- Copy the folders "bin" and "resources" from your "%APPDATA$\.minecraft" folder into the "jars" folder.
Where is the minecraft_server.jar file? Is it just my ordinary minecraft.jar?
I don't want to mess this up :sad.gif:.
Ahhh. That's a load of rubbish. Just get your "bin" and "resources" folders and put them in there. Ignore the first bit, unless you want to mod server-side(teh internets).
Another issue -.-
I put both of them in there and it says...
Minecraft.jar not found, skipping
Minecraft_server.jar not found, skipping
How do I copy all of the code? It isn't letting me -.-
Also do you have a yahoo email or something so we can communicate easier tommorow?
This would be a whole lot easier and I would <3 you forever :smile.gif:
Edit: I feel I did the paths wrong but how do I fix?
Edit of an edit: My path is C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin
It looks all correct to me I followed the path and everything is correct and I made sure the versions and everything was spelled correctly etc...
What am I doing wrong?
If you try to follow the guy's tutorial above, you'll probably get very frustrated, because it doesn't start you with the basics of simply learning how to program, or simply learning Java (if you are already at least familiar with programming basics).
*** Minecraft Coder Pack Version 2.9 ***
MCP 2.9 running in C:/Documents and Settings/Nathan/Desktop/JDK
Compiling Minecraft
sources/minecraft/net/minecraft/src/ModLoader.java:525: not a statement
exception;
^
1 error
*** minecraft_server.jar was not found, skipping
=== MCP 2.9 recompile script finished ===
Press any key to continue . . .
I was told since I'm not making a server mod I don't need the minecraft_server.jar
So I tried test_game (after changing how much health cakes gives) and it says...
*** Minecraft Coder Pack version 2.9 ***
*** Client no compiled, run recompile.bat
Press any key to continue . . .
So what am I doing wrong?
I would like a coder who knows the Java ropes to perhaps PM me and we can instant message so I can get help quicker :smile.gif:.
I would like to learn how to code in Java but I don't know where to start...
I wan't to start as low as you can start as I'm quite inexperienced but I have created a few applications in VB.
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
Very informative! Thank you! Can't wait to see what I can do :smile.gif:.
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
Where is the minecraft_server.jar file? Is it just my ordinary minecraft.jar?
I don't want to mess this up :sad.gif:.
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
Another issue -.-
I put both of them in there and it says...
Minecraft.jar not found, skipping
Minecraft_server.jar not found, skipping
How do I copy all of the code? It isn't letting me -.-
Also do you have a yahoo email or something so we can communicate easier tommorow?
This would be a whole lot easier and I would <3 you forever :smile.gif:
Edit: I feel I did the paths wrong but how do I fix?
Edit of an edit: My path is C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin
It looks all correct to me I followed the path and everything is correct and I made sure the versions and everything was spelled correctly etc...
What am I doing wrong?
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
I'm not calling you a dummy. It's a great series.
If you try to follow the guy's tutorial above, you'll probably get very frustrated, because it doesn't start you with the basics of simply learning how to program, or simply learning Java (if you are already at least familiar with programming basics).
Take it one step at a time.
If you are already very familiar with programming basics, then get:
http://www.amazon.com/Java-Dummies-Barr ... 415&sr=1-1
As I have no money because I'm a minor <.>.
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
Edit: Now it says when I try to recompile:
I was told since I'm not making a server mod I don't need the minecraft_server.jar
So I tried test_game (after changing how much health cakes gives) and it says...
So what am I doing wrong?
I would like a coder who knows the Java ropes to perhaps PM me and we can instant message so I can get help quicker :smile.gif:.
[simg]http://i.imgur.com/jnF8H.jpg[/simg]
┌─┐I say old chap that is a jolly good post!
┴─┴
ಠ_ರೃ
They don't give you any money? You never buy anything for yourself?