Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • User Submitted Tutorials
  • Cubicoder's 1.12 Tutorials
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
cubicoder

Cubicoder's 1.12 Tutorials

By cubicoder, June 20, 2018 in User Submitted Tutorials

  • Reply to this topic
  • Start new topic

Recommended Posts

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted June 20, 2018 (edited)

https://cubicoder.github.io/

 

These tutorials are meant to help others learn how to mod Minecraft using Forge, as well as learn the concepts behind the code. If you don’t know any Java, please go learn some and come back! There are lots of great Java tutorials online, and trying to mod Minecraft without a good understanding of Java is very confusing.

 

Any *constructive* feedback is welcome, as I'm trying to make these tutorials as accurate as possible to the "correct" way of doing things!

 

EDIT: Please note that the website has moved! I have decided to move to GitHub Pages as my host. All of the previous tutorials have been moved over.

The purpose of this change is to make it easier for people other than myself to contribute to these tutorials, as all it takes is a simple pull request to contribute a tutorial. I am open to contributions at this time; however please make sure you know what you’re talking about and explain the concepts thoroughly. Also, please keep tutorials to Minecraft versions 1.12.2 and above. More contributing guidelines should be available on the GitHub repo soon.

Edited April 20, 2019 by cubicoder
Changed website host
  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

diesieben07    7581

diesieben07

diesieben07    7581

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7581
  • 54893 posts
Posted June 21, 2018 (edited)

Some comments:

Quote

@Instance(Reference.MODID)

public static TutorialMod instance = new TutorialMod();

No. The point of @Instance is that it is filled in automatically by FML. Do not set it yourself. Also:

Quote

This isn’t strictly necessary, but it’s good practice to include.

No. It's not good practice. Use it if you need it. You probably don't.

 

Quote

Create four fields in your Reference class

Please at least explain why you have this class. I fail to see the point in it.

 

Quote

First, create a new package in src/main/java. This can be called anything you want.

No, it cannot: https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html

 

Quote

MODID: This is the internal ID of your mod.

Nothing about a mod ID is internal. It is a public identifier of the mod and should never be changed.

 

Quote

a client proxy, a server proxy, and a common proxy that will run code for both sides.

No. A "common proxy" is pointless. The point of proxies is to run side-specific code. Not common code. For common code you have your main mod class.

Also, do not use @EventHandler in your proxies, it only works in your main mod class.

 

Quote

The CommonProxy class should contain the Forge lifecycle methods, like the main class does.

No. This is completely missing the point and purpose of the proxy system.

 

Quote

To make life simpler later down the road, when we have many items to register, we’ll make an item “cache”

Nothing about this is a cache.

 

Quote

Finally, we need to register the models in our RegistryHandler class.

This completely defeats the mechanisms of @SidedProxy. You are referencing a client-only class (ModelRegistryEvent) in common code (RegistryHandler).

Also why are you clearing the "item cache" here? If you are not gonna use it for anything else, why not just use ForgeRegistries.ITEMS and filter by mod ID?

 

Quote

public TutorialTab() {

     super("tabTutorialMod");

}

You should include your mod ID in your creative tab unlocalized names as well.

 

Edited June 21, 2018 by diesieben07
  • Quote

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted June 21, 2018

Thanks for the feedback! Everything should be updated now to be a little more correct. This is why I wanted to make tutorials in the first place, because nobody ever tells new modders the correct way of doing things. They just have to figure it out for themselves, and usually they figure it out wrong. Hopefully, people will start learning things right now that I've gotten some help.

  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

diesieben07    7581

diesieben07

diesieben07    7581

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7581
  • 54893 posts
Posted June 21, 2018
  • Now your ClientProxy extends ServerProxy. This makes even less sense. There should be an interface Proxy and two classes (ClientProxy, ServerProxy) that implement it.
  • You still have the empty ***Init methods in your proxy classes. Why?
  • @SideOnly is not needed in your ModelRegistryHandler. Instead use the value attribute of the @EventBusSubscriber annotation.
  • Quote

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted June 21, 2018

Fixed (hopefully).

 

You know, maybe you should make your own tutorials. It seems like you're the only one around here that knows what you're doing. Looking at the source of mods like Tinker's Construct and Iron Chests, even those mods are doing things like using common proxies. I feel like there needs to be somewhere where people can look to find how to do this the right way, and the official Forge documentation just doesn't tell you that much.

  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

diesieben07    7581

diesieben07

diesieben07    7581

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7581
  • 54893 posts
Posted June 21, 2018 (edited)

You now just have a typo:

Quote

In the Reference class, add these two lines

There is no Reference class anymore.

 

And the I prefix for interfaces is stupid, but that is personal opinion (I guess).

 

41 minutes ago, cubicoder said:

You know, maybe you should make your own tutorials.

If only I had the time. Thing is, there is technically nothing wrong with these things. They work fine and they are not terrible game-breaking things. They are just bad practices that unnecessarily bloat your code and hide the true reason for things. There is a term for this: Cargo culting.

 

41 minutes ago, cubicoder said:

and the official Forge documentation just doesn't tell you that much.

That is why it's open source. Feel free to contribute.

 

Oh... and this:

2 hours ago, diesieben07 said:

You still have the empty ***Init methods in your proxy classes. Why?

Edited June 21, 2018 by diesieben07
  • Quote

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted June 21, 2018
Quote

If only I had the time.

I understand. Well, thanks at least for helping me with mine!

  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

zkiller20    0

zkiller20

zkiller20    0

  • Tree Puncher
  • zkiller20
  • Members
  • 0
  • 6 posts
Posted July 27, 2018

Idea :
- Item Capability
- Fluid Capability
- Energy Capability
- Custom Capability
- Electric Machine ( furnace, crusher, coal generator, etc.. )

  • Quote

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted July 28, 2018

Thanks for the ideas! I'm not planning on doing any more 1.12.2 tutorials due to the massive amount of changes coming in 1.13, but I'll definitely keep these in mind once I start again!

  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

H_SerhatY    1

H_SerhatY

H_SerhatY    1

  • Stone Miner
  • H_SerhatY
  • Members
  • 1
  • 73 posts
Posted September 4, 2018

Hello. If you want to make a list for 1.13 tutorials, I make a list.

- Development Environment

- Main Mod Class

- Proxies

- Custom Items

- Custom Blocks

- Language File

- Custom Creative Tab

- Custom Tools

- Custom Armors

- Crafting and Smelting Recipes

- Foods

- Crops

- Ore Gen

- Ore Dictionary

- Mobs(Standart Models)

- Mobs(Custom Models)

- Custom Workbench

- Custom Furnace

- Custom Chest

- Special Tools(for example, a sword that drops mob heads, an axe that drops trees completely, etc.)

- Special Armors(for example, a helmet that gives Night Vision, boots that gives Speed, etc.)

- Customizable Tools(like Tinkers' Construct)

  • Quote

My Mods:

More Strenghtened Tools Mod:

https://www.curseforge.com/minecraft/mc-mods/mstm

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted September 5, 2018

Thanks, but I don't really need a list (and most of your items were on my list anyway). Also, Forge for 1.13 isn't even out yet, so I'm definitely not in a position to be making tutorials for 1.13 anyway.

  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

Kaelym    0

Kaelym

Kaelym    0

  • Tree Puncher
  • Kaelym
  • Members
  • 0
  • 30 posts
Posted September 27, 2018

Thank you for the tutorials, any chance you'll be doing more in the future?

  • Quote

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted September 28, 2018

Yeah, there will be more eventually. I'd rather wait until 1.13 to make any new ones because of all the changes, but I might do a few more 1.12.2 tutorials because 1.13 is taking longer than I thought it would. Either way though, I'm really busy with school right now so I don't know when I'll have time to make more tutorials.

  • Thanks 1
  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
Share on other sites

profjb58    0

profjb58

profjb58    0

  • Tree Puncher
  • profjb58
  • Members
  • 0
  • 12 posts
Posted December 15, 2018 (edited)

So your modding tutorial might be the only one that makes sense without over complicating things, explains everything well and uses the new registry system for 1.12. In short, thanks. It's been a big help in understanding the basics.

 

p.s. a bunch of the changes suggested by @diesieben07 also really helped.

Edited December 15, 2018 by profjb58
  • Quote

Share this post


Link to post
Share on other sites

cubicoder    2

cubicoder

cubicoder    2

  • Tree Puncher
  • cubicoder
  • Members
  • 2
  • 13 posts
Posted December 15, 2018

Good to hear! Explaining things well and making sure everything was correct was one of my main goals in these tutorials (which is why I was very appreciative of diesieben07's help earlier).

  • Quote

Check out my tutorials at https://cubicoder.github.io/.

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Ronshark
      Bug logs Minecraft Code sortie 0

      By Ronshark · Posted just now

      je vous remercie énormement
    • Sr_endi
      [1.16.4]How to set the light value of an block

      By Sr_endi · Posted 15 minutes ago

      Thank you! I will try that.
    • Ironhead_
      Failure message: Missing License Information in file Mod File

      By Ironhead_ · Posted 56 minutes ago

      I'm playing on 1.14.4 and am only using the create mod, however I'm having to resort to adding JEI to see some recipes I'm stuck on. it doesn't let me use JEI without a licence
    • diesieben07
      (1.16.2) How do I use onPlayerTick?

      By diesieben07 · Posted 1 hour ago

      This will immediately crash the game, there are not just server side entities. The fact that it doesn't mean your event handler is not even running. It is not running, because @EventBusSubscriber only works with static event handler methods.
    • diesieben07
      7 FPS with a GT 1030 + i5-4690 (1.16.3)

      By diesieben07 · Posted 1 hour ago

      "Forge fix your terrible performance! this is horrible!" "Oh, I was using a mod that hugely increases render and world simulation load. sorry!"   Gotta love it how people jump to conclusions that with "just" 90 mods installed it must surely be Forge at fault.
  • Topics

    • Ronshark
      2
      Bug logs Minecraft Code sortie 0

      By Ronshark
      Started 16 hours ago

    • Sr_endi
      2
      [1.16.4]How to set the light value of an block

      By Sr_endi
      Started 19 hours ago

    • arkeN
      48
      Failure message: Missing License Information in file Mod File

      By arkeN
      Started October 11, 2020

    • e2rifia
      1
      (1.16.2) How do I use onPlayerTick?

      By e2rifia
      Started 1 hour ago

    • PotatoEz1
      4
      7 FPS with a GT 1030 + i5-4690 (1.16.3)

      By PotatoEz1
      Started 3 hours ago

  • Who's Online (See full list)

    • Master_Fenix01
    • Choonster
    • Ronshark
    • alexropi00
    • FreshMod
    • Angercraft
    • GreenBerry
    • MrLoop95
    • XenoPyax
    • Sr_endi
    • Aecht_Rob
    • kiou.23
  • All Activity
  • Home
  • Mod Developer Central
  • User Submitted Tutorials
  • Cubicoder's 1.12 Tutorials
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community