Jump to content

Recommended Posts

Posted (edited)

The best we have currently are the docs, although they're a bit outdated.

Edited by Novârch

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Posted
  On 7/6/2020 at 9:45 AM, zenglintao said:

How do you know how many methods Forge has and what they are used for?

Expand  

There's no manual, but you can look at the code of both forge stuff and vanilla MC stuff within your IDE. It is also searchable. Also, if you are unaware, definitely learn features of your IDE like looking up call hierarchy (will show places where the method/field is called from) and looking up type hierarchy (will show the tree of super/subclasses for the selected class). Things like this are invaluable.

Posted
  On 7/6/2020 at 10:26 AM, Ugdhar said:

没有手册,但是您可以在IDE中查看伪造和香草MC的代码。也可以搜索。另外,如果您不了解,则一定要学习IDE的功能,例如查找调用层次结构(将显示调用方法/字段的位置)和查找类型层次结构(将显示所选类的父级/子类的树) 。这样的事情是无价的。

Expand  

I have learned Java, but there are too few official examples

Posted
  On 7/6/2020 at 10:59 AM, zenglintao said:

too few official examples

Expand  

What would an official example look like? I mean, we can read the sourcecode. . .I don't think it gets more official than that. I've found tons and tons of examples searching the forums and google for what I was looking for, sometimes even finding stuff I didn't know about. And as long as it's a supported version, we are free to ask questions here and on the forge discord.

The forge docs give all the information needed to get a workspace setup, and as far as the basics, everyone that's ever made (or tried making) a tutorial at least makes it to blocks and items

 

I guess what I should ask is, what exactly are you looking for? And of course, the forge documentation is on github, so if you'd like something added/changed, you can make contributions/pull requests.

Posted

Hi

The short answer is - Forge isn't really an API at all in the sense that you might expect.  It does have some API-like aspects but if you're looking for documentation similar to the Guava library or the java util library, then you're not going to find it.  Some of the Forge code is documented well, and some of it is not documented at all.

Sometimes you can tell how the methods are intended to be used by reading the code, other times that is almost impossible to figure out.

 

The best way I have found to learn it is to google for tutorials and to look at good existing mods.  That can be difficult because there are a lot of not-very-good tutorials around.

 

-TGG

 

 

 

Posted
  On 7/6/2020 at 9:45 AM, zenglintao said:

How do you know how many methods Forge has

Expand  

Thousands.

 

  4 hours ago, zenglintao said:

and what they are used for?

Expand  

Whatever they need to be for.

 

It is easier to ask us how to do something.

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.

Posted
  On 7/6/2020 at 1:33 PM, Ugdhar said:

What would an official example look like? I mean, we can read the sourcecode. . .I don't think it gets more official than that. I've found tons and tons of examples searching the forums and google for what I was looking for, sometimes even finding stuff I didn't know about. And as long as it's a supported version, we are free to ask questions here and on the forge discord.

The forge docs give all the information needed to get a workspace setup, and as far as the basics, everyone that's ever made (or tried making) a tutorial at least makes it to blocks and items

 

I guess what I should ask is, what exactly are you looking for? And of course, the forge documentation is on github, so if you'd like something added/changed, you can make contributions/pull requests.

Expand  

https://wiki.mcjty.eu/modding/index.php?title=Main_Page

This tutorial is more detailed than the official one, but it's video format, I prefer to read the documentation

Posted
  On 7/6/2020 at 1:37 PM, TheGreyGhost said:

Hi

The short answer is - Forge isn't really an API at all in the sense that you might expect.  It does have some API-like aspects but if you're looking for documentation similar to the Guava library or the java util library, then you're not going to find it.  Some of the Forge code is documented well, and some of it is not documented at all.

Sometimes you can tell how the methods are intended to be used by reading the code, other times that is almost impossible to figure out.

 

The best way I have found to learn it is to google for tutorials and to look at good existing mods.  That can be difficult because there are a lot of not-very-good tutorials around.

 

-TGG

 

 

 

Expand  

Why do many method names change after forge upgrade, do I have to remember those method names again?

Posted
  On 7/6/2020 at 6:01 PM, zenglintao said:

https://wiki.mcjty.eu/modding/index.php?title=Main_Page

This tutorial is more detailed than the official one, but it's video format, I prefer to read the documentation

Expand  

The official documentation is not meant to be a tutorial. It's more of a getting started and concepts guide.

 

If you click the "Youtube tutorial step by step" link on that page you linked to, you'll get the txt version of the tutorials.

Posted
  On 7/6/2020 at 6:48 PM, Ugdhar said:

The official documentation is not meant to be a tutorial. It's more of a getting started and concepts guide.

 

If you click the "Youtube tutorial step by step" link on that page you linked to, you'll get the txt version of the tutorials.

Expand  

Um, i got it. Thanks

Posted

Hi

  On 7/6/2020 at 6:05 PM, zenglintao said:

Why do many method names change after forge upgrade, do I have to remember those method names again?

Expand  

The names change a lot because they're not the official mojang names.

Each version of minecraft has the names of all its methods, variables, classes scrambled (obfuscated).

The Forge guys (well, MCP actually) decompile the minecraft code, and then the community assign names for the scrambled methods, variables, and classes.  If the method signature hasn't changed, the name usually stays the same, but if it has changed then it relies upon someone in the community assigning a reasonable new name.  Quite often the names are misleading.  Sometimes the names change because different people have different opinions about what good names should look like.

 

In my experience, the changing of the names is usually not a big problem- the thing which causes you many hours of frustrating rework is the refactoring of the game features and classes, because your code breaks in fundamental ways and large parts of it need to be rewritten almost from scratch.

 

Some parts of Forge don't change much (the events, for example).  But anything that is tightly integrated with vanilla is likely to change a lot.

 

Cheers

 TGG

 

 

Posted (edited)

I would recommend looking at sources of other mods.

I used to learn modding via looking at Botania, which provides a pretty good example of various systems (particles, recipes, etc).

 

I personally find examples of Forge API not as necessary as code examples in other API/framework, as the vanilla code serves as a pretty good example itself. However, if you prefer examples, TGG has a tutorial consisting of examples: here.

Edited by DavidM

Some tips:

  Reveal hidden contents

 

Posted (edited)

Bit late to the thread here but I’m about a month into making a mod, thought I’d share how I’m learning stuff.

 

Basically it seems to be a combination of... Reading the docs for reference, watching tutorials on the more complicated topics, I’d honestly say registry events and the order in which they are fired confused me the most. Older tutorials can still be useful especially when understanding how minecraft works, e.g. the sided approach. Although make sure that tutorial isn’t ancient.

this is quite outdated now but is still very useful: http://jabelarminecraft.blogspot.com. Also provides links to other sites. I kinda of think of the tutorial stuff as unofficial documentation sometimes. Also mcjtys stuff is in note form as well if you look for it.

 

The rest is looking at others mods, asking for help on discord or on the forums, trying stuff out and failing very often.

 

oh also, if your looking at how to do something by viewing another mods code i seem to find it’s better to go with simpler mods so your not searching for what you need for long and the larger mods/older mods tend to have there own way of doing things which works great for them but is annoying for someone trying to understand the basics.

Edited by profjb58
Posted
  On 7/8/2020 at 3:06 AM, profjb58 said:

registry events and the order in which they are fired

Expand  

Just to make sure this fact is known, the only order of registration that you can rely on is Blocks -> Items -> Everything else, in a non-specified order. The order of any other registrations besides blocks and items is subject to change, even between different runs.

Posted
  On 7/8/2020 at 10:23 AM, Ugdhar said:

Just to make sure this fact is known, the only order of registration that you can rely on is Blocks -> Items -> Everything else, in a non-specified order. The order of any other registrations besides blocks and items is subject to change, even between different runs.

Expand  

Are you sure? I thought the order was Blocks -> Items -> Everything else in alphabetical order.

Posted
  On 7/8/2020 at 10:30 AM, vemerion said:

Are you sure? I thought the order was Blocks -> Items -> Everything else in alphabetical order.

Expand  

Positive, any perceived order after Blocks -> Items could change at any time.

I've seen people that know what they're talking about (including Lex) say it a million times.

  • Thanks 2
Posted
  On 7/8/2020 at 10:52 AM, Ugdhar said:

Positive, any perceived order after Blocks -> Items could change at any time.

I've seen people that know what they're talking about (including Lex) say it a million times.

Expand  

Alright, thanks for the info!

Posted (edited)
  On 7/8/2020 at 12:09 PM, diesieben07 said:

The order is intentionally not specified. Do not rely on the registry order. If you need to reference other registry entries, use RegistryObject.

Expand  

Apologies. I think I got registry events confused with the FML lifecycle events. Not entirely sure how.
I've had multiple attempts at modding since 1.7.10 so in comparison the registry events and deffered registry are a massive improvement. I think deffered registry is a fairly recent thing as well.

There is a thing on Jabelars site about FML lifecycle events & events in general as well although he uses a proxy which I don't think is needed really and it's a bit outdated. Some info on changes in 1.10.2 for the modeventbussubscriber so it's not too bad though.
http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html
 

lol tbf I don't know enough yet to really comment on this stuff. Basically just a combo of everything available seems to work in learning MC modding. Very different to programming for Android for example but a lot more fun :P.

Edited by profjb58
Posted
  On 7/8/2020 at 1:39 PM, profjb58 said:

Apologies. I think I got registry events confused with the FML lifecycle events. Not entirely sure how.
I've had multiple attempts at modding since 1.7.10 so in comparison the registry events and deffered registry are a massive improvement. I think deffered registry is a fairly recent thing as well.

There is a thing on Jabelars site about FML lifecycle events & events in general as well although he uses a proxy which I don't think is needed really and it's a bit outdated. Some info on changes in 1.10.2 for the modeventbussubscriber so it's not too bad though.
http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html
 

lol tbf I don't know enough yet to really comment on this stuff. Basically just a combo of everything available seems to work in learning MC modding. Very different to programming for Android for example but a lot more fun :P.

Expand  

If you're trying to follow a tutorial, use these: https://wiki.mcjty.eu/modding/index.php?title=YouTube-Tutorials

They're the most up to date, and best laid out, and are the ones suggested if you ask about tutorials on the forge discord.

McJty is also one of the few tutorial makers that doesn't force you to sit there and watch a video, as he has a text based version to go with them.

Posted (edited)

Mcjtys tutorials do seem to be the best for tutorials but the Jabelar stuff I posted i think of more like extended unofficial (if a bit outdated) documentation. It explains some of the concepts of forge and MC in general in greater detail than the official forge documentation, but not everything. It's also really well split up.
If you wanted to find the closest thing to an api manual or documentation with examples this is probably the closest you can get outside official forge documentation. There are sections which are very outdated on there though so take that with a grain of salt.

To be honest though there are so many mods out there, most being free to view on Github or simular platforms and with things like MinecraftByExample it's easier to just look at there structure and interpret what you need from it. Since MinecraftByExample is commented as well that helps a lot.

Edited by profjb58

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Please read the FAQ (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/). It asks you to not post a reply to a thread with your own question in rule #2. Unfortunately I do not have any experience trying to run Java MC on an android device. Someone may have experience with it and be able to help, but I'm guessing that it's not officially supported, and your mileage may vary.  
    • I moved your post into its own topic (due to Rule #2 in the FAQ).  Please read the FAQ (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/) as directed at the top of the support forum, and post logs as described there using a site like https://mclo.gs or similar, and post the link here.  
    • I'm having a similar problem. Optifine won't let me start the game and when i install Rubidium + Oculus, it tells me Flywheel requires Sodium 0.6.0. and that my current version of Sodium is 0.5.3 I don't have Flywheel or Sodium in my mods folder, I play on Forge and Sodium is for Fabric and Sodium 0.6.0 doesn't exist for Minecraft 1.20.1  
    • I have spent all morning trying to get stencils to work, and I can't seem to get any sort of response from the game? I have a basic transparent and white texture I want the shape of the cutout to be and then a texture that should be cut out, yet the texture draws fully no matter what I do. There was one old post that did it, however using  his code I have had zero luck.  This is my code so far, however its changed so many times... Please help me! poseStack.pushPose(); // Set up shader and blending RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); // Enable stencil test GL11.glEnable(GL11.GL_STENCIL_TEST); GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT); // Draw portal shape to stencil buffer RenderSystem.stencilFunc(GL11.GL_ALWAYS, 1, 0xFF); RenderSystem.stencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE); RenderSystem.stencilMask(0xFF); RenderSystem.colorMask(false, false, false, false); RenderSystem.depthMask(false); guiGraphics.blit(maskTest,10,10,7,7,7,7); // Now draw portal texture through the stencil RenderSystem.stencilFunc(GL11.GL_EQUAL, 1, 0xFF); RenderSystem.stencilMask(0x00); RenderSystem.colorMask(true, true, true, true); RenderSystem.depthMask(true); guiGraphics.fill(0,0,30,30,Color.YELLOW.getRGB()); GL11.glDisable(GL11.GL_STENCIL_TEST); RenderSystem.disableBlend();  
    • { "parent": "wuntare:block/box" } This is a item model script, and it have not a model, idk. Then block is there, the model is there. But in hand is block with missing-texture and default block model, not custom. version: 1.21.5 forge: 55.0.21
  • Topics

×
×
  • Create New...

Important Information

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