I searched on the forum and couldn't find any useful information so
I'm starting this thread to serve the purpose of helping people creating
mods.
In fact, i'm myself in need of further directions to create mods (not textures mod).
This thread will gather all information I get from differents mod author that are willing to
participate. I will eventually post my discoveries too (when I'll make some).
IMPORTANT : Source code of Minecraft is presently obfuscated, which means all function name,
objects, items are renamed to random thing and not actual name.
That also mean. With each update made by the client, you'll be loosing all mods functionality.
If you mod something, you'll have to remod it with the new functions name.
New tool : [url=http://www.minecraftforum.net/viewtopic.php?f=25&t=58464]Mod creator pack[/url]
Just put your minecraft.jar or minecraft_server.jar in a bin file, click decompile.bat and all files
will be decompiled plus a patch will be applied to :
- Fix the errors generated by the decompiling process
- Rename incorrect class name ( by, if, do ).
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=48407]Apple Tree Mod[/url]
- Tree have now a slight probability of dropping apples !!!
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=52703]Bookshelves mod[/url]
- Bookshelves will drop bookshelves instead of nothing when destroyed
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=55319]Flint mod[/url]
- Flint does not drop anymore from gravel. You now have to craft it using gravel (3:1 ratio)
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=51532&p=851149#p851149l]Rideable pig +saddle[/url]
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=47148]Risugami's Mods[/url] (by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=64988]Risugami[/url])
- Light sensor
- Elemental arrows (Fire,explosive,Ice and Eggs)
- Stackable food and buckets
- Furnace fix (using lava won't destroy the bucket)
- More worlds (extend worlds saves to 10 )
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=55045]Assorted Novelties & Conveniences[/url]
- a lot of mini-mods ( Low gravity, Underwater torches, torches on glass, more to come )
[url=/www.minecraftforum.net/viewtopic.php?f=25&t=55700&sid=dfd36ac88211e9e4dfbce82fe4e6bf65]Simple map[/url]
- add a minimap into minecraft ( by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=52994]Mr Messiah[/url]
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=50050]Redstone Burnout Fix[/url] (by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=30383]fr0stbyte124[/url]
- disables the burnout effect on redstone torches.
- Whenever you want to modify a .jar file, open archive, apply your modification.
- Do not unizip and re-zip a .jar, just modify it directly in the archive.
- Always backup your original file.
- To avoid having the game update itself, delete the Meta-inf folder for your modded game
(obfuscation scramble the code at each update, making your mod invalid)
- Decompiling class files : [url=http://java.decompiler.free.fr/?q=jdgui#downloads]Jd-gui[/url]
- Unzip your minecraft.jar into a work folder
(Minecraft folder found in %appdata% folder)
- Start Jd-gui and just drag a class file in it to see all class files appearing in the program
- Compiling files back : [ur=http://netbeans.org/]Netbeans[/url]
- Once modified class compiled back, just drag the mod. into your jar file (opened with 7-zip)
Quote from blitz104 »
Ok, I almost have it figured out. Just follow these steps:
1. Create a new project in Netbeans
2. Extract the files from the original minecraft_server.jar (or minecraft.jar for a client only mod)
to any empty folder
3. Right click the project name on the left of the screen in Netbeans and go to
properties -> libraries -> compile (tab)
4. Go to add Jar/Folder, and add the folder created in step 2
5. Now, add a .java file to the source packages (whichever one you want to edit, should have already decompiled it in jd-gui)
6. Once you have finished editing this java file, right click the java file on the left and select compile file
7. Look at the directory give at the bottom of the window, that's where you'll find the class file. Add this file to the original server jar file
8. 8. Use [url=http://www.7-zip.org/download.html]7-zip[/url] and right-click
minecraft_server.jar (or minecraft.jar) then open archive and drop your modified
class file into the package.
**** If you get some errors in some class, they are probably doing a call to the if.class
Rename those call to iffix.class and change the if.class name accordingly.
________________________________Optional tools______________________________
- [url=http://winmerge.org/downloads]WinMerge[/url]
This tool can be useful for studying an original class file to a modified one (taking
an existing mod) to learn what modifications were made and deduct how to create your mods
(until further tutorials, examples, etc... are provided)
[url=http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc]Doxygen[/url]
Get a more structured code ...
(Look on page 3 of this thread for indications of how to use it)
________________________________Other useful links______________________________
[url=https://spreadsheets.google.com/ccc?key=0AoJyOQ6MBcR5dGJ1a0xCWTRZeUN0UlRtSm1reW54MkE#gid=0]List of minecraft class and what they does (collaborative)[/url]
[url=http://www.minecraftwiki.net/wiki/Data_values]Block and items id[/url]
- Read second post for further details of how to use it.
[url=http://mcdocs.team-talk.net/]Dedicated Minecraft Modding Forum (NEW)[/url]
Goals:
- Basic: Adding a new chicken food item to Minecraft
- Bonus: Making it drop from a critter when it dies, and adding a new "pluck" ability to our chicken to repurpose the feathers
- Extra Credit: Baking that item to make it give more health
Findings of others for the current version of minecraft (client)
Cn.class Actual level data
di.class Generic item-type superclass & list mapping item ids
ev Recipes
ly.class Generic block type superclass
Kh.class generic dynamic-object (players, mobs, carts, etcc) superclass ( Position : ak,al,am; velocity : an,ao,ap; rotation : aq,ar)
Oj.class Generic Superclass for Food (int paramInt1, int paramInt2)
Quote from birdcloud »
And one more thing: hm.class (s.class for the server, I believe) is used whenever objects (like dynamic objects, chests, etc) that aren't blocks (which are a part of the level data) need to save or load themselves. You'll see twin functions in a lot of classes that take a single hm parameter and pass a lot of descriptive strings to it. These are very good hints as to what the member variables of the class do. For example, the save function from kh.java:
fq.class is empty... :sleep.gif:
fr.class has menu items and values...
gc.class covers the Multiplayer "Connect to:" screen
hw.class mentions terrain.png
l.class has many X's :biggrin.gif:. Probably in tribute to X (From X's adventures in Minecraft)
mv.class covers the pig
fk.class mentions gui.png
etc... etc... etc... I could go on like this forever...
Quote from WMAMP3 »
Minecraft Alpha v1.1.2_01
oj.class - Generic superclass for Food Methods public oj(int paramInt1, int paramInt2)
paramInt1 - Passed to di superclass. Appears to be the Item ID.
paramInt2 - Sets attribute 'a'. Unsure of purpose; Does not appear to be stack-size. Requires further testing. Hearts Restored * 2.
Analysis / Findings:
Debugging has revealed this class is instantiated at login. Initial analysis appears to indicate paramInt2 determines how much health the item heals:
Debug: Item<4> - paramInt2: 4 // Apples heals 2.
Debug: Item<26> - paramInt2: 10 // Mushroom soup heals 5.
Debug: Item<41> - paramInt2: 5 // Bread heals 10
Debug: Item<63> - paramInt2: 3 // Pork heals 1.5
Debug: Item<64> - paramInt2: 8 // Grilled pork heals 4.
Debug: Item<66> - paramInt2: 42 // Surprisingly, the Golden Apple restores 21 hearts. (Instead of 10 - the current maximum)
public ev a(ev paramev, cn paramcn, dm paramdm)
paramev - Stack related - Used to decrement stack count. (paramev.a)
paramcn - Not used; nor is it used by di generic item-class. Likely used elsewhere.
paramdm - Damage related. Determines how much health to restore.
Analysis / Findings:
Method b of paramdm restores health. Suggests that dm represents an entity - likely as it extends kh dynamic-object generic (Possibly main player. Method will only restore health to a living player i.e. >0 health). It will not restore above maximum. Also appears to do something related to maximum health. (Related to attributed 'j' and 'aW' in dm - warrants further investigation.)
Noteworthy is the fact that the parameter is signed and no validation is done on 'negative' healing. This means that damaging foods (Poisons) should work. This has been tested and confirmed.
Attributes
aT (Inherited) - Max Stack Size.
a - Hearts Healed by Item * 2.
dw.class - Crafting Class Methods public dw()
To Test: Instantiated at start-up
Analysis / Findings:
Makes a number of calls, passing itself as parameter - requires further investigation.
Following this is a list of calls to a (see below).
public ev avoid a(ev paramev, Object[] paramArrayOfObject)
paramev - New item "stack" to create (Constructor takes a block-generic or item-generic and a number (init. stack size).
paramArrayOfObject - Name-Value pair for recipe - organisation as follows (Untested)
Analysis / Findings:
The first index is the top row of the recipe. Second is (optionally) the middle row. Third is (optionally) the bottom row.
The next index is the first character used to represent the top row.
The next index is the item or block represented by that character.
First parameter: Make a new stack of minecart tracks (16 in size).
Second parameter: Recipe - lets examine in detail:
"X X", "X#X", "X X", ---> Let's re-arrange into a more familiar format:
X X
X#X
X X
Next, lets look at the parameters that follow in the object array:
Character.valueOf('X'), di.m, Character.valueOf('#'), di.B
So:
'X' maps to di.m
'#' maps to di.B
di is the generic item class.
Attribute m: public static di m = new di(9).a(23);
To shorten the analysis: The constructor for di takes an integer, which represents the decimal data value of the item - 256.
256 + 9 = 265 = Iron Ingot (http://www.minecraftwiki.net/wiki/Data_values)
So X is iron ingot.
Attribute B public static di B = new di(24).a(53).d();
256 + 24 = 280 = Stick
Substitute "Iron Ingot" for X and "Stick" for # and we end up with:
Which is indeed the recipe for iron ingot.
Further information:
The size of the "Recipe box" appears to be dynamic - this seems to indicate a somewhat easily extensible crafting area.
The "item" and "block" substitution function appears to function for arbitrary length. This means there should be no upper bound on the items that can be used.
Take the above with a grain of salt; need to test.
I use jd-gui to decompile, and netbeans to recompile. You can't try to decompile the whole jar, and you can't try to de-obfuscate things, because you're not modding the whole thing, just individual classes. I know little about the client, as the server is my realm of expertise. A few tips:
1) ez.class (currently) is a list of all item classes mapped to their data value (minus 256).
2) ff.class (currently) is a list of all block classes likewise mapped to their data value (actual value, not minus 256).
3) dy.class (currently) is the world, and you use dy.a(x,y,z) to get a block, and dy.d(x,y,z,v) to set one.
4) any entities use "L,M,N" instead of "X,Y,Z" for their coordinates.
Rollback Post to RevisionRollBack
My ankle's uncle is my uncle's ankle. It's true! My Server Mods: Runecraft SMP Server Mod - java class replacer for SMP which adds magic runes. Llamacraft SMP Server Mod - bucket fix, lava nerf, etc.
Hi all, thanks for noticing my mod, but I can't add to this discussion. The thing is, I tried to contact Notch to ask about how he feels about modding but got no answer, so I've got to go with what I see he's posted elsewhere, which is that he's fine with it as long as we don't overstep certain lines.
One of those, I have to feel, is that we respect his decision to obfuscate the source code. Hence, I'll not be sharing any of what I know on that - sorry. I've done what I need to do to make the mods but I haven't and wouldn't share that without permission. I also make sure when I release mods my own code is in obfuscated form so it doesn't give anything away.
You will want to add Risugami's Mods and MrMessiah's Minimap mod to your list.
MrMessiah:
I don't think Notch really cares as long as you don't distribute the jar, the executable, or any source code. The issue is that the next update will break all these great mods when he re-obfuscates the code. I know he stated he will eventually produce an exposed API for modding. I wish I had more patients.
1) ez.class (currently) is a list of all item classes mapped to their data value (minus 256).
2) ff.class (currently) is a list of all block classes likewise mapped to their data value (actual value, not minus 256).
3) dy.class (currently) is the world, and you use dy.a(x,y,z) to get a block, and dy.d(x,y,z,v) to set one.
4) any entities use "L,M,N" instead of "X,Y,Z" for their coordinates.
This is the best place to start. Here are the equivalents for the client jar (currently):
[*:27g366l4]di.class is the generic item-type superclass & a list mapping item ids - 256 to corresponding item-type classes
[*:27g366l4]ly.class is the generic block-type superclass & a list mapping block ids to corresponding block-type classes
[*:27g366l4]cn.class is the interface to the actual level data
[*:27g366l4]kh.class is the generic dynamic-object (players, mobs, carts, etc) superclass; (ak, al, am) is position, (an, ao, ap) is velocity, (aq, ar) is rotation
And one more thing: hm.class (s.class for the server, I believe) is used whenever objects (like dynamic objects, chests, etc) that aren't blocks (which are a part of the level data) need to save or load themselves. You'll see twin functions in a lot of classes that take a single hm parameter and pass a lot of descriptive strings to it. These are very good hints as to what the member variables of the class do. For example, the save function from kh.java:
@SuperLlama
Thanks for the tips, the tools and the server coding examples.
@BirdCloud
Thanks. These are very useful informations to start too :smile.gif:
P.s. : First post updated
P.P.S : Don't worry, I won't thank everyone at each posts. hehe
(Even though I'm thankful)
P.P.P.S : My native language is not english, so forgive me if I make some
"3 years old" errors sometimes.
@MrMessiah
I understand your concern and respect your decision.
However, if you read the Modding and mapping description on the main forum page
Share, discuss and request new maps, show other users have to create specific things and find out about new mapping tools. Game modifications can be discussed and provided here, however modified clients cannot be distributed.
Game modifications are ok.
But thank you to have answered my PM about this thread.
If you ever change your mind, I welcome your knowledge :smile.gif:
Thanks to Quarg and SpongeBob for adding some mods to the list
All very nice mods but I think that they all need MAC support such as installing the .class files which seems to be harder than I thought
Can't you just do the same as in windows ?
I mean :
- open minecraft.jar with winrar for mac or some unzipping utility (just open archive, not unzip it)
- Copy class files into the archive
- Profit (or not ?)
I'm also looking for some help with creating some mods. I'm a proficient coder and I like to think that I won't need my hand held.
I'm interested as a first little project to alter the SMP server to allow getting and setting of player coordinates by OPs and the console. So I got a fresh copy and JD-GUI and decompiled. Opened up MinecraftServer.java and found the tp command. Based on what I gathered from that, I guessed getting and setting the coordinates with a command would look something like this:
// Getting coordinates
} else if (str1.toLowerCase().startsWith("getcoords ")) {
localObject1 = str1.split(" ");
if (localObject1.length == 2) {
localObject2 = this.f.h(localObject1[1]);
if (localObject2 == null) {
localef.b("Can't find user " + localObject1[1] + ". No coords.");
} else {
a(str2, "Coords: " + localObject2.l + " , " + localObject2.m + " , " + localObject2.n + " , " + localObject2.r + " , " + localObject2.s);
}
} else {
localef.b("Syntax error, please provide a source.");
}
// Setting coordinates
} else if (str1.toLowerCase().startsWith("setcoords ")) {
localObject1 = str1.split(" ");
if (localObject1.length == 7) {
localObject2 = this.f.h(localObject1[1]);
if (localObject2 == null) {
localef.b("Can't find user " + localObject1[1] + ". No tp.");
} else {
try {
((ea)localObject2).a.a(Double(localObject1[2]),Double(localObject1[3]),Double(localObject1[4]),Double(localObject1[5]),Double(localObject1[6]));
a(str2, "Teleporting " + localObject1[1] + " to location...");
}
catch (NumberFormatException e)
{
localef.b("Syntax error, bad coords.");
}
}
} else {
localef.b("Syntax error, please provide a source and 5 coords.");
}
So now I'm working on recompiling this and getting it back into the JAR. I tried using eclipse and adding the server jar to the project's path but I had no luck getting the compiler to recognize the classes from the jar and link against them.
Trying Netbeans now, because I really never liked eclipse.
Ok, this just isn't working for me. I've tried eclipse and netbeans, tried getting "minecraft_server.jar" into the classpath and nothing seems to work. I even tried compiling from the command line:
And on and on for 33+ errors. It's like it's ignoring my -cp flag altogether, both in the IDEs and on the command line. What super obvious thing am I missing?!
Sage Pourpre, in your original post, you said to modify the jar file directly in the archive. How can you do that? Don't you have to extract a class file to open it in jd gui and netbeans?
Sage Pourpre, in your original post, you said to modify the jar file directly in the archive. How can you do that? Don't you have to extract a class file to open it in jd gui and netbeans?
In fact, you do both things.
You have to extract your minecraft.jar into a folder
Then, you decompile class files to .java with Jd-gui
You make all the modifications you need and recompile modified .java back to .class
Then, you open the minecraft.jar archive using 7-zip.
Finally, you drag & drop modified class files into the jar files.
Don't forget to delete meta-inf directory and making the assumption
your mod is well done, the game should launch normally, except, with your
mod inside.
Quote from SpongeBob »
This thread was helpful. I put out my first simple mod thanks to it:
Nice !
Glad to hear that.
I'll add the mod to the list :smile.gif:
That said, if you don't mind, could you explain how you did recompile your file ?
I got tons of errors when trying to recompile.
Here's what I do :
Open netbeans IDE 6.9.1
Create new Java - Class Library project
Put all minecraft.jar files previously decompiled back to .java (using jd-gui) into the
src folder of my project.
Then I use the Run menu and "Build Project" or "Compile File" but... I must have missed
something important because it does not compile.
Also, how did you came to the conclusion that jz.class was holding tree parameters ?
I'm starting this thread to serve the purpose of helping people creating
mods.
In fact, i'm myself in need of further directions to create mods (not textures mod).
This thread will gather all information I get from differents mod author that are willing to
participate. I will eventually post my discoveries too (when I'll make some).
IMPORTANT : Source code of Minecraft is presently obfuscated, which means all function name,
objects, items are renamed to random thing and not actual name.
That also mean. With each update made by the client, you'll be loosing all mods functionality.
If you mod something, you'll have to remod it with the new functions name.
New tool : [url=http://www.minecraftforum.net/viewtopic.php?f=25&t=58464]Mod creator pack[/url]
Just put your minecraft.jar or minecraft_server.jar in a bin file, click decompile.bat and all files
will be decompiled plus a patch will be applied to :
- Fix the errors generated by the decompiling process
- Rename incorrect class name ( by, if, do ).
Here's a list of Mods already existing :
[url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=56710]SpongeBob's mods[/url]
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=48407]Apple Tree Mod[/url]
- Tree have now a slight probability of dropping apples !!!
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=52703]Bookshelves mod[/url]
- Bookshelves will drop bookshelves instead of nothing when destroyed
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=55319]Flint mod[/url]
- Flint does not drop anymore from gravel. You now have to craft it using gravel (3:1 ratio)
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=51532&p=851149#p851149l]Rideable pig +saddle[/url]
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=47148]Risugami's Mods[/url] (by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=64988]Risugami[/url])
- Light sensor
- Elemental arrows (Fire,explosive,Ice and Eggs)
- Stackable food and buckets
- Furnace fix (using lava won't destroy the bucket)
- More worlds (extend worlds saves to 10 )
[url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=54461]Birdcloud's mods[/url])
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=45168]AutoCart[/url]
- Carts revamped ( Physics law hater ? )
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=55045]Assorted Novelties & Conveniences[/url]
- a lot of mini-mods ( Low gravity, Underwater torches, torches on glass, more to come )
[url=/www.minecraftforum.net/viewtopic.php?f=25&t=55700&sid=dfd36ac88211e9e4dfbce82fe4e6bf65]Simple map[/url]
- add a minimap into minecraft ( by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=52994]Mr Messiah[/url]
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=50050]Redstone Burnout Fix[/url] (by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=30383]fr0stbyte124[/url]
- disables the burnout effect on redstone torches.
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=54593]Repair tools[/url] (by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=66730]Seronis[/url] )
[url=http://www.minecraftforum.net/viewtopic.php?f=1012&t=29244&hilit=runecraft]Runecraft[/url] (by [url=http://www.minecraftforum.net/memberlist.php?mode=viewprofile&u=30224]SuperLlama[/url])
- Magic rune creation in Minecraft (server only)
[url=http://www.minecraftforum.net/viewtopic.php?f=25&t=45440]Terrain Mod[/url]
- Hack the terrain generator to suit what you want (server only)
___________________Starting editing the code ____________________________________
Tools needed
- Opening .jar : [url=http://www.7-zip.org/download.html]7-zip[/url] (.jar = .zip container)
- Whenever you want to modify a .jar file, open archive, apply your modification.
- Do not unizip and re-zip a .jar, just modify it directly in the archive.
- Always backup your original file.
- To avoid having the game update itself, delete the Meta-inf folder for your modded game
(obfuscation scramble the code at each update, making your mod invalid)
- Decompiling class files : [url=http://java.decompiler.free.fr/?q=jdgui#downloads]Jd-gui[/url]
- Unzip your minecraft.jar into a work folder
(Minecraft folder found in %appdata% folder)
- Start Jd-gui and just drag a class file in it to see all class files appearing in the program
- Compiling files back : [ur=http://netbeans.org/]Netbeans[/url]
- Once modified class compiled back, just drag the mod. into your jar file (opened with 7-zip)
8. 8. Use [url=http://www.7-zip.org/download.html]7-zip[/url] and right-click
minecraft_server.jar (or minecraft.jar) then open archive and drop your modified
class file into the package.
**** If you get some errors in some class, they are probably doing a call to the if.class
Rename those call to iffix.class and change the if.class name accordingly.
________________________________Optional tools______________________________
- [url=http://winmerge.org/downloads]WinMerge[/url]
This tool can be useful for studying an original class file to a modified one (taking
an existing mod) to learn what modifications were made and deduct how to create your mods
(until further tutorials, examples, etc... are provided)
[url=http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc]Doxygen[/url]
Get a more structured code ...
(Look on page 3 of this thread for indications of how to use it)
________________________________Other useful links______________________________
[url=https://spreadsheets.google.com/ccc?key=0AoJyOQ6MBcR5dGJ1a0xCWTRZeUN0UlRtSm1reW54MkE#gid=0]List of minecraft class and what they does (collaborative)[/url]
[url=http://www.minecraftwiki.net/wiki/Data_values]Block and items id[/url]
- Read second post for further details of how to use it.
[url=http://mcdocs.team-talk.net/]Dedicated Minecraft Modding Forum (NEW)[/url]
________________________________TUTORIALS _______________________________
Finally !
The first modding tutorial ever !
[Newbie Level][url=http://mcdocs.team-talk.net/clientside-stuff-f4/newbie-level-kungfu-chicken-t12.htm#17]KungFu Chicken[/url]
Goals:
- Basic: Adding a new chicken food item to Minecraft
- Bonus: Making it drop from a critter when it dies, and adding a new "pluck" ability to our chicken to repurpose the feathers
- Extra Credit: Baking that item to make it give more health
__________________________________________________________________________
Don't hesitate to share anything useful here to the benefit of us all.
- Coding tips
- Mods not listed here
- other useful informations
- etc...
To be edited...
Cn.class Actual level data
di.class Generic item-type superclass & list mapping item ids
ev Recipes
ly.class Generic block type superclass
Kh.class generic dynamic-object (players, mobs, carts, etcc) superclass ( Position : ak,al,am; velocity : an,ao,ap; rotation : aq,ar)
Oj.class Generic Superclass for Food (int paramInt1, int paramInt2)
1) ez.class (currently) is a list of all item classes mapped to their data value (minus 256).
2) ff.class (currently) is a list of all block classes likewise mapped to their data value (actual value, not minus 256).
3) dy.class (currently) is the world, and you use dy.a(x,y,z) to get a block, and dy.d(x,y,z,v) to set one.
4) any entities use "L,M,N" instead of "X,Y,Z" for their coordinates.
My Server Mods:
Runecraft SMP Server Mod - java class replacer for SMP which adds magic runes.
Llamacraft SMP Server Mod - bucket fix, lava nerf, etc.
One of those, I have to feel, is that we respect his decision to obfuscate the source code. Hence, I'll not be sharing any of what I know on that - sorry. I've done what I need to do to make the mods but I haven't and wouldn't share that without permission. I also make sure when I release mods my own code is in obfuscated form so it doesn't give anything away.
Just my 2c
You will want to add Risugami's Mods and MrMessiah's Minimap mod to your list.
MrMessiah:
I don't think Notch really cares as long as you don't distribute the jar, the executable, or any source code. The issue is that the next update will break all these great mods when he re-obfuscates the code. I know he stated he will eventually produce an exposed API for modding. I wish I had more patients.
This is the best place to start. Here are the equivalents for the client jar (currently):
[*:27g366l4]di.class is the generic item-type superclass & a list mapping item ids - 256 to corresponding item-type classes
[*:27g366l4]ly.class is the generic block-type superclass & a list mapping block ids to corresponding block-type classes
[*:27g366l4]cn.class is the interface to the actual level data
[*:27g366l4]kh.class is the generic dynamic-object (players, mobs, carts, etc) superclass; (ak, al, am) is position, (an, ao, ap) is velocity, (aq, ar) is rotation
And one more thing: hm.class (s.class for the server, I believe) is used whenever objects (like dynamic objects, chests, etc) that aren't blocks (which are a part of the level data) need to save or load themselves. You'll see twin functions in a lot of classes that take a single hm parameter and pass a lot of descriptive strings to it. These are very good hints as to what the member variables of the class do. For example, the save function from kh.java:
Thanks for the tips, the tools and the server coding examples.
@BirdCloud
Thanks. These are very useful informations to start too :smile.gif:
P.s. : First post updated
P.P.S : Don't worry, I won't thank everyone at each posts. hehe
(Even though I'm thankful)
P.P.P.S : My native language is not english, so forgive me if I make some
"3 years old" errors sometimes.
@MrMessiah
I understand your concern and respect your decision.
However, if you read the Modding and mapping description on the main forum page
Game modifications are ok.
But thank you to have answered my PM about this thread.
If you ever change your mind, I welcome your knowledge :smile.gif:
Thanks to Quarg and SpongeBob for adding some mods to the list
I'm changing the settings for generated maps.
Chunk of code to add a recipe that create an inert block or item.
It involves :
- Adding an item to the item index
- Adding a recipe
- Linking it to it's new sprite.
Posting my results later.
viewtopic.php?f=25&t=45440
Can't you just do the same as in windows ?
I mean :
- open minecraft.jar with winrar for mac or some unzipping utility (just open archive, not unzip it)
- Copy class files into the archive
- Profit (or not ?)
But, I don't have a mac, so I can't confirm this.
I'm interested as a first little project to alter the SMP server to allow getting and setting of player coordinates by OPs and the console. So I got a fresh copy and JD-GUI and decompiled. Opened up MinecraftServer.java and found the tp command. Based on what I gathered from that, I guessed getting and setting the coordinates with a command would look something like this:
So now I'm working on recompiling this and getting it back into the JAR. I tried using eclipse and adding the server jar to the project's path but I had no luck getting the compiler to recognize the classes from the jar and link against them.
Trying Netbeans now, because I really never liked eclipse.
And on and on for 33+ errors. It's like it's ignoring my -cp flag altogether, both in the IDEs and on the command line. What super obvious thing am I missing?!
class, interface, or enum expected everywhere.
There is obviously something wrong but I can't say what.
Maybe one of the actual modders will pass by this thread again soon *cross fingers*
viewtopic.php?f=25&t=48407
In fact, you do both things.
You have to extract your minecraft.jar into a folder
Then, you decompile class files to .java with Jd-gui
You make all the modifications you need and recompile modified .java back to .class
Then, you open the minecraft.jar archive using 7-zip.
Finally, you drag & drop modified class files into the jar files.
Don't forget to delete meta-inf directory and making the assumption
your mod is well done, the game should launch normally, except, with your
mod inside.
Nice !
Glad to hear that.
I'll add the mod to the list :smile.gif:
That said, if you don't mind, could you explain how you did recompile your file ?
I got tons of errors when trying to recompile.
Here's what I do :
Open netbeans IDE 6.9.1
Create new Java - Class Library project
Put all minecraft.jar files previously decompiled back to .java (using jd-gui) into the
src folder of my project.
Then I use the Run menu and "Build Project" or "Compile File" but... I must have missed
something important because it does not compile.
Also, how did you came to the conclusion that jz.class was holding tree parameters ?
Regards, Sage Pourpre