How did you learn to mod / code Java?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

the_j485

King of the Wicked
Dec 19, 2012
2,964
3,099
298
Look behind you
I'm quite keen on learning to code Java and indeed then go on to mod, however I can't really find anything good to help me.

Could anyone who does indeed know where I might be able to learn suggest some places to go find out?
 

Pokefenn

New Member
Jul 29, 2019
976
0
0
I learned to code by coding...
I looked at code, tried to figure it out.
If i was 100% stumped i would google or ask someone.
 
  • Like
Reactions: Padfoote

MigukNamja

New Member
Jul 29, 2019
2,202
0
0

Yes, this is an excellent course. I made my own mod just to play with by simply following this.[DOUBLEPOST=1406561358][/DOUBLEPOST]
What kind of code did you look at? Minecraft mods? Normal Minecraft?

The best way to learn is a small, open-source mod that you like playing with. Since you're experienced with it, it will help when you're trying to make sense of the code.

In order, here's what I recommend (this is what I found worked best for me):

1. Basic Java and Object-Oriented tutorials, not related to Minecraft

Spend maybe 2 or 3 hours on this to start. Then, come back as you need more​

2. Pahamir and vswe's tutorials linked above

Interleave this with the Java as you come across concepts you don't understand​

3. Start your own, very simple mod

Come back to (1) and (2) above as you need​

4. Look at source code from another mod

5. Make a better mod

Come back to (1), (2), and (4) as needed​
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
Yes, this is an excellent course. I made my own mod just to play with by simply following this.[DOUBLEPOST=1406561358][/DOUBLEPOST]

The best way to learn is a small, open-source mod that you like playing with. Since you're experienced with it, it will help when you're trying to make sense of the code.

In order, here's what I recommend (this is what I found worked best for me):

1. Basic Java and Object-Oriented tutorials, not related to Minecraft

Spend maybe 2 or 3 hours on this to start. Then, come back as you need more​

2. Pahamir and vswe's tutorials linked above

Interleave this with the Java as you come across concepts you don't understand​

3. Start your own, very simple mod

Come back to (1) and (2) above as you need​

4. Look at source code from another mod

5. Make a better mod

Come back to (1), (2), and (4) as needed​
If you have coded in another Object-Oriented language before number 1 is mostly unnecessary at least in the beginning stages. Personally I learned Objective-C and so far have not needed to look at more Java code. That will probably change when I get to the more advanced stuff, but that is no different from your method. Just my opinion :p
The best thing I've ever watched for getting into minecraft modding with forge is Pahimar's Let's Mod series: http://www.pahimar.com/tutorials/lets-mod/

This is for after you learn basic java though. It's also still on-going, so no rush.
Yes I really like pahimar's letsmod series (especially reboot) and only after watching up to the recipes portion I am able to make a very simple mod (Obsidian tools and other basic things of the such).
 
C

chbachman

Guest
Yes, this is an excellent course. I made my own mod just to play with by simply following this.[DOUBLEPOST=1406561358][/DOUBLEPOST]

The best way to learn is a small, open-source mod that you like playing with. Since you're experienced with it, it will help when you're trying to make sense of the code.

In order, here's what I recommend (this is what I found worked best for me):

1. Basic Java and Object-Oriented tutorials, not related to Minecraft

Spend maybe 2 or 3 hours on this to start. Then, come back as you need more​

2. Pahamir and vswe's tutorials linked above

Interleave this with the Java as you come across concepts you don't understand​

3. Start your own, very simple mod

Come back to (1) and (2) above as you need​

4. Look at source code from another mod

5. Make a better mod

Come back to (1), (2), and (4) as needed​


Especially number 4.

CoFH mods, open blocks, ee3, botania, buildcraft, All of these are open source.

When implementing a feature, think, has this or something like this been done before? If so then check that mod to see if it is open source. If it is, check to see how they did it.
 

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
When implementing a feature, think, has this or something like this been done before? If so then check that mod to see if it is open source. If it is, check to see how they did it.
I mean, you'd be better off checking to see if vMC does it first, because that's typically a lot easier to mimic if the needed methods are already in place.

Anyway, to answer the OP, I'm still learning, and I started off learning basic Java stuff, then jsut experimenting and reading Minecraft, Thermal Expansion, and IC2 code.
 
C

chbachman

Guest
I mean, you'd be better off checking to see if vMC does it first, because that's typically a lot easier to mimic if the needed methods are already in place.

Anyway, to answer the OP, I'm still learning, and I started off learning basic Java stuff, then jsut experimenting and reading Minecraft, Thermal Expansion, and IC2 code.

But typically most of the variables are jumbled around, which makes it hard to read. Modders write more readable code.
 
  • Like
Reactions: SatanicSanta