• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hey guys, I'm new to the forum. I have done some Minecraft modding in the past, specifically on version 1.7.2 I tried to get back into the modding on version 1.12.2 to find that things are (in my opinion) a lot more complicated and difficult.  I believe I have done all the file naming right but for some reason the language file (en_us.lang) and the texture for my first item (ruby_gem) won't load. The exception it gives me is that the file is not found. I've tried searching everywhere but can't find out what I did wrong. I may have some bad practice here and there, feel free to correct me on that. But please do it in the most comprehensive way, because simply reading the Forge documentation has got me all dizzy and confused lol. I have basic Java understanding, as in, I know the basics of object oriented programming, but I'm still very new to this.   ItemInit:   package mod.mores.init; import mod.mores.objects.ItemBase; import net.minecraft.item.Item; import net.minecraft.item.ItemAir; import java.util.ArrayList; import java.util.List; public class ItemInit { public static final List<Item> ITEMS = new ArrayList<Item>(); public static final Item RUBY_GEM = new ItemBase("ruby_gem"); }   ItemBase: package mod.mores.objects; import mod.mores.init.ItemInit; import mod.mores.modid.Mores; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class ItemBase extends Item { public ItemBase(String name) { setRegistryName(name); setUnlocalizedName(name); setCreativeTab(CreativeTabs.MATERIALS); ItemInit.ITEMS.add(this); } public void registerModels() { Mores.proxy.registerItemRenderer(this, 0, "inventory"); } }   Main: package mod.mores.modid; import mod.mores.items.swords.RubySword; import mod.mores.proxy.CommonProxy; import mod.mores.util.Reference; import mod.mores.util.handlers.RegistryHandler; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION) public class Mores { @Mod.Instance public static Mores instance; @SidedProxy(clientSide = Reference.CLIENT, serverSide = Reference.COMMON) public static CommonProxy proxy; public static ToolMaterial ruby; @EventHandler public void preInit(FMLPreInitializationEvent event) { RegistryHandler.preInitRegistries(); //ToolMaterials ruby = EnumHelper.addToolMaterial("ruby", 3, 1345, 8.0F, 2.5F, 14); } @EventHandler public void init(FMLInitializationEvent event) { RegistryHandler.initRegistries(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { RegistryHandler.postInitRegistries(); } @EventHandler public static void serverInit(FMLServerStartingEvent event) { RegistryHandler.serverRegistries(); } }   ClientProxy: package mod.mores.proxy; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ClientProxy extends CommonProxy { @Override public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory")); } @Override public void render() { } }   CommonProxy: package mod.mores.proxy; import net.minecraft.item.Item; public class CommonProxy { public void registerItemRenderer(Item item, int meta, String id) { } public void render() { } }   RegistryHandler: package mod.mores.util.handlers; import mod.mores.init.BlockInit; import mod.mores.init.ItemInit; import mod.mores.modid.Mores; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @Mod.EventBusSubscriber public class RegistryHandler { @SubscribeEvent public static void onItemRegister(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ItemInit.ITEMS.toArray(new Item[0])); } @SubscribeEvent public static void onModelRegister(ModelRegistryEvent event) { for(Item item : ItemInit.ITEMS) { Mores.proxy.registerItemRenderer(item, 0, "inventory"); } for(Block block : BlockInit.BLOCKS) { Mores.proxy.registerItemRenderer(Item.getItemFromBlock(block), 0, "inventory"); } } @SubscribeEvent public static void onBlockRegister(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(BlockInit.BLOCKS.toArray(new Block[0])); } public static void preInitRegistries() { Mores.proxy.render(); } public static void initRegistries() { } public static void postInitRegistries() { } public static void serverRegistries() { } }   Loading errors:   [20:50:41] [Client thread/ERROR] [FML]: Exception loading model for variant mores:ruby_gem#inventory for item "mores:ruby_gem", normal location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model mores:item/ruby_gem with loader VanillaLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:513) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23] at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23] Caused by: java.io.FileNotFoundException: mores:models/item/ruby_gem.json at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[SimpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?] ... 20 more [20:50:41] [Client thread/ERROR] [FML]: Exception loading model for variant mores:ruby_gem#inventory for item "mores:ruby_gem", blockstate location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model mores:ruby_gem#inventory with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:296) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:513) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23] at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23] Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?] ... 20 more     My main is located at mod/src/main/java/mod/mores/modid/mores.java My language file is located at mod/src/main/resources/assets/mores/lang/en_us.lang My texture is located at mod/src/main/resources/assets/mores/textures/items/ruby_gem.png My model JSON is located at mod/src/main/resources/assets/mores/models/item/ruby_gem.json    
    • RegistryObject is a supplier that holds an item, use Supplier#get to get the Item where has already implemented IItemProvider.
    • I'm very new to modding (this is my first mod), so sorry if this seem stupid.  I'm using data generators to generate my recipes and whenever I run them it doesn't give any errors, but it also fails to generate the recipes.   My Code:  package net.Pinary_Pi.my1stmod.data.recipes;   import java.util.function.Consumer; import net.minecraft.data.IFinishedRecipe; import net.minecraft.data.RecipeProvider; import net.Pinary_Pi.gear.item.CraftingItems; import net.Pinary_Pi.my1stmod.setup.ModItems import net.Pinary_Pi.my1stmod.setup.ModTags; import net.minecraft.data.DataGenerator; import net.minecraft.data.ShapedRecipeBuilder;   public class ModRecipesProvider extends RecipeProvider {     public ModRecipesProvider(DataGenerator generatorIn) {         super(generatorIn);     }          @Override     protected void registerRecipes(Consumer<IFinishedRecipe> consumer) {         ShapedRecipeBuilder.shapedRecipe(CraftingItems.STORAGE_BLOCKS_SILVER)         .key('#', ModTags.Items.INGOTS_SILVER)         .patternLine("###")         .patternLine("###")         .patternLine("###")         .addCriterion("has item", hasItem(ModTags.Items.INGOTS_SILVER))         .build(consumer);                  ShapedRecipeBuilder.shapedRecipe(CraftingItems.INGOTS_SILVER, 9)         .key('#', ModTags.Items.STORAGE_BLOCKS_SILVER)         .patternLine("#")         .addCriterion("has item", hasItem(ModTags.Items.STORAGE_BLOCKS_SILVER))         .build(consumer);     } }   I'm pretty sure I need to change the CraftingItems to something different, but everything else I put there causes an error that says "The method shapedRecipe(IItemProvider, int) in the type ShapedRecipeBuilder is not applicable for the arguments (RegistryObject<Item>, int). " I know I need to do something with IItemProvider, but I don't know how.   CraftingItems is a library that someone named SilentChaos512 made that I saw him using in his mods; I tried to copy what he did with it and put it in my mod. I'm pretty sure I'm not using it correctly.
    • It's been discussed for a long time, but none of the solutions worked for me (maybe I did not did them right). So I have created another mod (basically a tool) and I want to use it in another environment, this is what I've tried:   1. run normal build ./gradlew.bat build, and then put built jar from lib into the mods folder. 2. run jar build ./gradlew.bat jar, and then put built jar from reobfJar into the mods folder. 3. build jar using existing ide options, and then put built jar from lib into the mods folder.   1 & 2 causes crashes, and 3 does not work at all (not detected).   What is the correct way of doing it in 1.16.4? Thanks.
    • GUIs aren't that difficult. There's dozens of tutorials for them and they haven't really changed all that much in ten years.
  • Topics

  • Who's Online (See full list)