Jump to content

Some questions about making mods


Recommended Posts

I had a few problems making the mod,
Who can help me with the answer?🤔

The first question is: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

The second question is: java.lang.IllegalArgumentException

The third question is: java.io.FileNotFoundException: itnt:models/item/tnt_ball.json(My ModID is: itnt)

The file path is: zzzz.itnt.itnt.java

package zzzz.itnt;

import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;

@Mod(modid = itnt.MODID, name = itnt.NAME, version = itnt.VERSION, acceptedMinecraftVersions = "[1.12,1.13)")
public class itnt
    public static final String MODID = "itnt";
    public static final String NAME = "Ikun tnt";
    public static final String VERSION = "1.0";

    private static Logger logger;

    public void preInit(FMLPreInitializationEvent event)
        logger = event.getModLog();

    public void init(FMLInitializationEvent event)
        // some example code
        logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());

The file path is: zzzz.itnt.item.tntBall.java

package zzzz.itnt.item;

import net.minecraft.item.Item;
import zzzz.itnt.itnt;

public class tntBall extends Item {
    public tntBall()

The file path is: zzzz.itnt.item.ItemRegistryHandler.java

package zzzz.itnt.item;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.registries.IForgeRegistry;

public class ItemRegistryHandler
    public static final tntBall TNT_BALL = new tntBall();

    public static void onRegistry(Register<Item> event)
        IForgeRegistry<Item> registry = event.getRegistry();

    public static void onModelRegistery(ModelRegistryEvent event)
                new ModelResourceLocation(TNT_BALL.getRegistryName(),"inventory"));

And in the resources folder have:










                          (The tnt_ball.json code:

    "parent": "item/generated",
    "textures": {
        "layer0": "dirtgy:items/dirtball"







     (The mcmod.info code:

  "modid": "Itnt",
  "name": "Ikun tnt",
  "description": "Ikun tnt mod",
  "version": "${version}",
  "mcversion": "${mcversion}",
  "url": "",
  "updateUrl": "",
  "authorList": ["zzzz"],
  "credits": "Ikun tnt, zzzz",
  "logoFile": "",
  "screenshots": [],
  "dependencies": []


(The pack.mcmeta code:

    "pack": {
        "pack_format": 3,
        "description": "Ikun tnt resources"


This is the code I wrote, who can help me to see where the problem?


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.

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.