Tag: Minecraft: Java Edition modding

  • A Helpful List of Minecraft 1.9.4 Modding Resources

    If you’re a newbie Minecraft modder, you may often find yourself looking for some helpful article on a certain modding aspect, whether it be block states, JSON files, the OreDictionary, or whatever it is that you would like to know more about. Unfortunately, there isn’t really any central place on the internet that serves as a hub for all modding tutorials/articles/how-tos, and especially not for the latest version. This can be quite a problem, and it can make learning to mod rather difficult.

    Over the course of many days spent working on my mod, Colore, I’ve found quite a few good articles on various Minecraft Forge modding topics that should be pretty helpful if you’re just starting out or want to learn about a part of modding that you haven’t explored yet. I would like to point out, though, that you do need to have at the very least a decent understanding of how programming works, as well as some of the particular things about the Java programming language that are important to know. You should also already have an understanding of various basic Minecraft concepts like metadata, tile entities, chunks, and the distinction between blocks, items, and entities. So, here is my list of various helpful resources for learning how to make Minecraft mods. Some of these are tutorials, some are articles explaining how Minecraft and Forge work, and some are code examples. Most of these should be at least mostly up-to-date for 1.9.4, though several were written for older versions, so keep in mind that some things may have changed names and/or been revised to work in a different way since the article was written.

    The official MinecraftForge Documentation: While very short and not very extensive (and also slightly out-of-date as it hasn’t been updated much since 1.8), this is a good source of basic Forge info such as how to setup your development workspace, an explanation of the block states JSON formats, some guidelines for structuring your mod’s code, and some other helpful info for beginners.

    The Temporal Reality Modding Knowledge Base wiki: Here’s a really neat series of tutorials that should cover pretty much all the basics of modding in 1.9.4, as well as 1.8.9, should you decide to backport your mod to that version.

    Shadowfacts’ Forge modding tutorials: Another good series of modding tutorials. I would recommend reading both this and the above series to get two slightly different views on how to do the basics… remember that this is programming, and there are many ways to organize your code and accomplish the same thing. All the ways shown in various tutorials will end up calling the same Forge/Minecraft methods in the end, but it’s up to the modder to choose how to organize his code to do it in the most efficient, clean, readable, and modular way possible.

    Choonster’s description of the model-loading process: This is a very helpful article on how model-loading works as of 1.9/1.9.4, which is one of the main differences from 1.8/1.8.9, so this is a good complement to older articles/tutorials written for those older versions or to help modders who have coded for 1.8.x but not 1.9.

    GreyMinecraftCoder’s guide to how Forge works: Although it hasn’t been updated since 1.8, this is still a very very helpful resource (and still mostly up-to-date except for some method-changes/renames and some changes to model-loading in more recent versions) for understanding all basic Forge concepts like events, model/texture-rendering, how Forge runs your code, and various other important topics. Unlike most tutorials you’ll find online, this is actually more like a series of encyclopedia articles, actually explaining how everything actually works rather than just being a set of fool-proof instructions that don’t actually teach you anything.

    TheGreyGhost’s MinecraftByExample: A picture is worth a thousand words, and a mod full of example code for various kinds of blocks, items, tile entities, and more is worth a thousand questions. One of the best ways to learn how Forge and Minecraft code works is to study working examples and try and figure out how and why they work. (But don’t copy-and-paste, as you’ll learn nothing and you won’t progress in your understanding of modding at all.) This is a really great example mod that should help if you’ve run into a problem with your mod and you wish you had an example to study of something similar to what you want to do. It is currently written for 1.8.9, but will probably be updated to 1.9.4 soon.

    The Forge Forums: When all else fails, this is the go-to place for solving modding problems. Often you can find an existing topic already covering a problem you’re experiencing, and a quick search is generally all that is needed to find an answer to most problems you’re having. It’s also a good learning experience to just read the various posts that come up concerning various topics, as you can pick up a good bit of understanding of how Forge works simply by reading through past discussions. Finally, here are some helpful tips:

    • Whenever the game crashes, ALWAYS read the crash logs. 90% of the time you can find the exact line of code that is flawed by reading the crash logs, and you can easily discover just what exactly is crashing the game. Sometimes it’s trying to reference objects that haven’t been initialized yet, sometimes it’s trying to access info you don’t have access to, sometimes it’s doing silly things like trying to pass items as parameters to a function that takes blocks, but whatever the problem is, you can almost always find out what you’re doing wrong simply by analyzing the crash log and walking through your code to discover any logical errors you’ve made.
    • Don’t copy-paste code from tutorials. As tempting as this is, you should always take the time to read and analyze the code you see in tutorials so you understand HOW and WHY it works, so you’ll be able to do it on your own without constantly referencing a tutorial. Manually typing out the code can help you to remember how to do something and understand it better as well, as it causes you to think about the code more.
    • Study the Minecraft and Forge classes. Reading the source code is one of the best ways to learn how something works… not only in Minecraft modding, but in programming in general. You can often discover where functionality originates from and how to hook into and/or extend that functionality to use in your mod by simply looking around in the code for something similar to what you’re working on. For example, if you want to understand how slabs work, look at the BlockSlab, BlockHalfSlab, BlockDoubleSlab, and ItemSlab classes to see what they do, and try and figure out which methods you would need to override and which classes you would need to extend in order to make your own.
    • Before asking a question, make sure someone else hasn’t already answered it. For most basic modding problems, the answers are already on the Forge Forums on an existing topic, because chances are that someone else has already had your problem before. You don’t want to your time or other people’s time asking a question that you could have found the answer to yourself. Always check the Forge Forums and Google before asking for help, to make sure that the help you need isn’t already out there.
    • 95% of the problems you encounter in programming will be stupid little mistakes that will make you want to bang your head against a wall. Be prepared to search for hours and hours for the cause of a problem, only to discover it was all because of something silly like typing a “1” instead of an “i” or forgetting to actually call a method you’ve created. Try not to get discouraged, and take a break if your brain feels exhausted… a good night’s rest and a refreshed mind can help to solve many problems.

    I hope this post has been helpful to any new Minecraft modders out there! These resources have definitely been very helpful in my modding experience, and I hope they will be useful in yours as well!

  • Colore 1.1: Slabs & Future Plans

    Colore 1.1: Slabs & Future Plans

    Woo-hoo! After since the release of the Colore mod, I’ve finally finished the first update, which adds 70 colorful slabs to correspond with the 70 existing monochrome colored blocks already in the mod. The mod has been ported to 1.8.9 for this release, and will soon be released for 1.9 as well!

    Of course, some of you may wonder… why just slabs? What about stairs? Why did it take so long? Well, to answer those questions, I’ve been quite busy lately and I’d been struggling with figuring out how to get the slabs in the mod to work since I first released the mod and began work on the 1.1 update. I am still rather new to modding, and it took quite a while for me to wrap my head around how to implement the slabs properly… mainly how to make the half-slabs stack and make the double-slabs drop half-slabs. At the time when I first released the Colore mod, I thought adding slabs would be easy, but my knowledge of the Minecraft and Forge code was pretty limited and I got confused and lost very quickly.

    Eventually though, after several periods when I didn’t have any time to work on the mod and then got lost whenever I tried to start working on it again, and after staring at and observing the Minecraft code and doing some research for several hours, I finally figured out what I was doing wrong and figured out how to get the slabs working. I now understand metadata, block states, and slabs a lot better than I did before, and I’ve learned a good amount about modding in general, so (hopefully) adding stairs, fences, and etc. should be relatively easy, using what I’ve now learned.

    The Colore mod, as I’ve said in my previous blog post about it, is pretty much the result of me wanting to learn how to make Minecraft mods and be able to add pretty much any sort of basic thing like blocks, items, armor, entities, and so on. That’s why I chose to make a mod about colored stuff. It was a simple concept which could be applied to a lot of basic Minecraft objects. So where do I plan to go with this mod in the future? Well, I know there IS such a thing as a mod having too many features and being too bloated, so don’t expect colored-everything to eventually be in this mod, but here are the things I intend to add in the next update, update 1.2:

    • Stairs
    • Fences
    • Walls
    • Transparent blocks, slabs, stairs, and panes
    • Bows
    • Shields
    • Rebalancing of tools/armor for 1.9

    So assuming I don’t run into any annoying problems while coding, the next update should be a lot bigger than 1.1 is. I intend to release 1.2 for 1.9 and up, but not for 1.8.9.I don’t really feel like there’s a need to backport the mod to 1.8.9 as most other mods are already starting to come out for 1.9 (and soon 1.9.4) as the changes between it and 1.8.9 aren’t nearly as big as the changes from 1.7.10 to 1.8. The vanilla block states format also changed in 1.9, and I really don’t want to create around 100 block state .json files in the old format and then re-create them all for 1.9.

    As for what happens after 1.2 is finished, I intend to begin work on another update, called 1.3 (of course), and this would probably be the last update to add anything to the mod. The stuff I intend to add at this point will be some more difficult-to-code stuff, like colored liquids and glowing (light-source) colored blocks. I might also throw in transparent tools and armor, if I don’t wind up adding that in the 1.2 update. This update would be released for 1.9.4 (which Forge should be updated to by that time) and also 1.10 if that has been released by that time. Depending on how many significant changes there are, if any, in 1.9.4, I may also release that version of the mod for 1.9 as well.

    After 1.3, I’ll probably go on to work on other mods (a mod all about chocolate would be cool…), but I’ll continue to update Colore to the newest Minecraft versions as long as I can, and I’ve also considered making “expansion/add-on” mods for Colore, which could feature things like color-coded redstone components (with mechanics to make yellow redstone interact with & connect to yellowish-orange or yellowish-green redstone but not interact with or interfere with orange or green or blue or red… redstone? Red-redstone? Hmmm…), a Colore dimension with custom entities (because why not and because I want to learn about custom world gen and entities), or other things that are either big and complex enough to be put into their own mod, or too superfluous for most people to want them in the base mod.

    And so, being me, I’ve managed to take the very simple idea of a basic little beginner’s Minecraft mod that adds colored blocks… and then crank it up to eleven, turning it into a serious project that has tons of stuff planned for the future…

    And if you’ve read this far, I guess you must be interested in the mod, so what are you waiting for? Go ahead and download it and have fun! (Unless of course you want to play in 1.9, in which case wait a couple (hopefully) days and download the 1.9 version when I’ve finished porting the mod.)

  • Colore: My First Minecraft Mod

    Colore: My First Minecraft Mod

    I’ve been working on this since I started my YouTube channel, and only now has it finally been officially launched. The Colore Mod, my first Minecraft mod. It really is a fairly simple mod, but it has taught me a lot about how the Minecraft code works, and given me some good practice in Java. I have a lot of ideas for things that could be added in the next update, including slabs, stairs, fences, doors, bows, shields, and transparent-colored blocks and panes, so this initial release is only the beginning.

    This mod actually started out as a very basic idea, however. I was originally only making the mod to learn the very core basics of Minecraft modding, and so “SuperGeniusZeb’s Colored Blocks Mod”, as I called it, would only add 16 colored blocks, 16 essences, the 6 ores, and the 6 unrefined essences. The 16 colors would have been the same ones used across Minecraft’s colored blocks like stained glass, stained clay, and wool: red, orange, yellow, lime, green, cyan, light blue, blue, purple, magenta, pink, white, light gray, gray, black, and brown. Having accomplished this, though, I became unsatisfied with the limited range of colors, and decided to not base my mod’s color palette off of the standard vanilla Minecraft multi-color blocks. Instead I decided to go with a total of 14 colors: red, reddish orange, orange, orangish yellow, yellow, yellowish green, green, cyan (greenish blue), blue, indigo (bluish purple), purple, magenta (purplish red or reddish purple), brown, and grayscale (which represented white, black, and the shades in between). I decided that each of the base colors would have 5 shades: normal, light, lighter, dark, and darker, and this made there a total of 70 different colors. I chose 5 shades because I thought 3 shades would miss out on some useful variations of colors, and because 7 or more shades would be too difficult to distinguish, and also rather superfluous. I then decided that each of the 14 base colors would be its own block, using metadata to distinguish between the 5 shades. I considered doing the reverse and having 5 blocks for each of the shades, with the metadata being used to determine the color. I chose not to do this, however, because that would use up 14 of the 16 possible metadata states, and I wanted to leave plenty of room in the metadata of each block for future changes and additions. (Maybe when I add slabs, the double/full slab blocks will just be the regular blocks with metadata that makes them drop slabs instead of full blocks.)

    And that’s when things got difficult. Being totally inexperienced in the field of Minecraft modding, I got confused when trying to add metadata to the blocks, and my code, which was honestly sort of a mess to start with, became messier. From a lack of comprehension of some of the standard practices and concepts of modding to countless numbers of silly errors like creating but never actually calling important functions, I just got really confused, and took a break from trying to code the mod because of how frustrated I got. Having jumped from one tutorial to another, all of which seemed to teach different ways of doing different things, I wasn’t really sure what to do, and at the time I still didn’t quite understand what exactly those tutorials were teaching.

    Eventually though, I decided to basically clean-wipe my code and start from scratch, reworking the organization of the packages and the naming of the classes to fit my desired style, and I finally figured out some of the things I simply didn’t understand before, and soon the mod’s percentage of completion began to rapidly increase, and soon it was only a matter or copying-and-pasting and finding-and-replacing of some JSON model files before my mod was finished. By , the mod was complete, and it was only a matter of promoting it and getting it published and uploaded everywhere.

    That took a while. I wanted to have my website up, running, and fairly polished before I released the mod, and I also had to take all the screenshots and make a cool release trailer. After various delays and lots of time spent, I finished my website, took all the pictures, and finished the trailer. Then it was just a matter of uploading the trailer to my YouTube channel and posting my mod to the various Minecraft mod sites and forums.

    And so finally, the Colore mod is now officially released to the public! I hope to continue working on the mod and keeping it up-to-date with the latest Minecraft Forge releases, as well as make some other mods as well. Maybe a chocolate mod? Hmmm…

    Oh, and by the way, the picture above is what happened when I made a silly mistake in adding the armor models. I mixed up the assets\colore\models folder with the assets\colore\textures\models folder, and broke every texture except the armor model textures. 😛