Jump to content

Is there any comprehensive documentation for Forge and Minecraft?


QuantumPie

Recommended Posts

I'm interested in creating mods for MC but as I research how to do this there doesn't seem to be a lot of documentation. The Forge Documentation seems to be the only official source of information I can find but it's not very comprehensive. Other than that I've been looking at mcjty's tutorials and MinecraftByExample          but that will only get you so far. Looking at those tutorials, I see a lot of inheritance going on but when I look at the parent classes implementation, there are seldom any comments explaining anything. Am I just supposed to scour through MC's source code and figure things out as I go? There is a guide on mcjty's wiki that says how to make a dimension but not biomes, how would I go about learning how to implement that? Better said, how did mcjty learn how to implement his own dimension assuming he had no other wiki to use? I'm also having a hard time finding up to date information on the internal workings of MC. I know a lot changed post 1.8 and most of those guides were pre, I'm not sure what differs. The only thing I'm guessing hasn't changed is there being only a client and server thread with a game loop.

Link to comment
Share on other sites

2 hours ago, QuantumPie said:

Am I just supposed to scour through MC's source code and figure things out as I go?

Basically yes. There are so many changes between versions keeping a comprehensive guide would be almost impossible. Its kinds why the forums exist in the first place. Its kind of a comprehensive guide. That has people who are constantly adding to it by making more posts. It's just not as organized as a guide. 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

2 hours ago, QuantumPie said:

Am I just supposed to scour through MC's source code and figure things out as I go?

Pretty much. There's comments on a lot of methods that tell you what they're for and most parameters can be inferred based on their Type.

2 hours ago, QuantumPie said:

how did mcjty learn how to implement his own dimension assuming he had no other wiki to use?

See prior comment. Mostly either by trial and error or by having done dimension work on a prior version and already knowing some of the things that were required.

2 hours ago, QuantumPie said:

but not biomes, how would I go about learning how to implement that?

Biomes work pretty much just like blocks and items. You just won't see them "spawn" naturally because they haven't been added to the BiomeController* (which is the code that handles worldgen).

 

*BiomeProvider, I can't remember what it's currently called. There's one for each dimension (and one for flat worlds).

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

2 hours ago, QuantumPie said:

So would you happen to know of any recent post / guide that explains the underlying structure of Minecraft? 

No I dont believe anyone has approached with this particular question before.

 

2 hours ago, QuantumPie said:

I'd like to get a better idea before delving into the source code.

Basically everything you've said is true.

 

Minecraft singleplayer has many threads. The two you should concern yourself with the most is the logic threads. Denoted as server and client. You must do everything logic based that you dont want the client to lie about on the server thread. There is a third thread you might end up encountering, but less often. It is the network thread. You must only decode encode and receive on the network thread, processing must be deferred to the server/client thread. You'll see an example on the forge docs website. However in 1.13+ world gen is handled on it's own thread(keep world generation thread safe). Typically you figure this out by World#isRemote being false. And vice versa for client thread. Any client only code cannot run on the server at all. This is known as reaching across logical sides. Any attempt to do this will cause seemingly random hard to reproduce bugs in singleplayer and will crash the dedicated server.

 

Speaking of the dedicated server this is the jar file you launch when host a public server. The dedicated server has all client only code stripped of it and has no client thread. Thus the crashing.

 

Yes Minecraft also runs a tick and frame system instead of just a frame system. As such there are supposed to be 20 ticks in a second. You can use this to determine a change in time by implementing a variable every tick. This also creates a need for a partialTick float when rendering. Because while we update at a constant 20 ticks/second we can render as many frames/second as we want. Partial ticks represents the fractional(0.0-1.0) time between the next tick.

 

If I missed anything important anyone is welcome to add on. If you have a more specific question about the internal runnings please ask. Might need a new thread for it depending on its relation to this one.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.