minecraft Creating a Basic Item with Forge


Introduction

Creating a simple item with Forge is one of the first tasks an aspiring modder will have to learn. How to do that has changed over the various versions of Minecraft and is probably at a "moderate" difficulty post 1.7.10 due to the sheer number of easy to make mistakes, particularly with making it render properly.

Remarks

If something goes wrong and your custom item has a missing texture (black/purple) or model (default cube that's too large when held) check the log. Problems of this sort will almost always show up in the log, provided that you have registered things correctly.

The first thing that will show up is "Exception loading model for variant..." line or similar, telling you which block or item failed to load properly. After a dozen or so lines beginning with at... will be another line starting Caused by...

This "Caused By" line is the important one, it will tell you which file failed to load properly and can be one of several errors, such as:

  • Malformed JSON (your JSON file isn't valid and has a typo)
  • File Not Found (the file Minecraft is looking for is not properly named or in the right place)
  • Missing Variant Exception (your Blockstate JSON is incomplete)

You may even get more than one failing error for a single mistake! If you don't know which item is the problem, comment out every block and item you know works, reduce the error list down to the block (or blocks) in question. You may have to do this several times.

Additionally, a mixing texture shows up as differently as a simple list all of the missing resources for a given domain (mod ID).