Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[FIXED - 1.12.2]Exception loading model for variant


Altyrah
 Share

Recommended Posts

Hi everyone,

 

I just began Minecraft and Java development, and I'm stucked with, I think, a modelLoader issue.

 

Here is the problem I get when I launch the debug mod: 

Spoiler


[15:24:08] [main/ERROR] [FML]: Exception loading model for variant simelyaressources:myr#inventory for item "simelyaressources:myr", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model simelyaressources:item/myr 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:559) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
    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_221]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.io.FileNotFoundException: simelyaressources:models/item/myr.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
[15:24:08] [main/ERROR] [FML]: Exception loading model for variant simelyaressources:myr#inventory for item "simelyaressources:myr", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model simelyaressources:myr#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:559) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
    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_221]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:25) [start/:?]
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

Also, here is my github repo, with the last commit where I am stucked https://github.com/Nolween/SimelyaRessources

I don't know if its a path to model issue, or if it's in my functions, but I got no textures, and also no translation of my item into th game.

 

I would be so happy if you find th solution. I already searched into the forum but it doesn't fit :(

 

Thank you !

Edited by Altyrah
FIXED
Link to comment
Share on other sites

17 minutes ago, Altyrah said:

Caused by: java.io.FileNotFoundException: simelyaressources:models/item/myr.json

It's not finding your model file. Did you refresh your workspace after creating the file? How did you setup your workspace? Is your resources folder a source folder?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

11 minutes ago, Animefan8888 said:

It's not finding your model file. Did you refresh your workspace after creating the file? How did you setup your workspace? Is your resources folder a source folder?

Yes, I just refreshed again my workspace, I even went until rebooting my computer to be sure, but still the same issue.

 

My resources foler is set as a source folder yes. What do you mean by saying how did you setup your workspace?

 

I work with Intellij IDEA, the game is well launched, but there is only this problem. 

I don't know if my repo would give you the answer about it :( 

 

P.S. here is my structure into my resources folder :

image.png.e7dfbc9290ee9964d947c6a3f62aee49.png

 

Edited by Altyrah
Link to comment
Share on other sites

 

5 hours ago, ZigTheHedge said:

I've experienced the same behavior with new Gradle and latest IDEA. Fixed by running gradlew genIntelliJRuns from separate command line (not from IDEA Terminal).

Thank you ZigTheHedge, unfortunately, I already use an other terminal (Cmnder) to execute command like genIntelliJRuns or setupDecompWorkspace, because I already had this kind of problems with IDEA (certificate)

 

Still looking for the solution :(

Link to comment
Share on other sites

4 minutes ago, LegendLength said:

I believe it should be marked as a resources folder rather than a sources folder.

A sources folder is just a folder included in the classpath for your environment.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.

Guest
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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Got the rotation working. I had to look at LivingEntityRenderer#render and setupRotations a little more closely, and I realized that I needed to change the custom entity's yBodyRot and yBodyRotO.  private static boolean renderingCustomEntity = false; private static CustomEntity customEntity; private static void refreshCustomEntity(LocalPlayer localPlayer, LivingEntity livingEntity) { if (customEntity == null || customEntity.isRemoved()) { customEntity = ModEntities.CUSTOM_ENTITY.get().create(localPlayer.clientLevel); } if (!customEntity.level.dimension().equals(livingEntity.level.dimension())) { customEntity.discard(); } } @SubscribeEvent public static void replaceMobModel(RenderLivingEvent.Pre<LivingEntity, EntityModel<LivingEntity>> event) { LocalPlayer localPlayer = Minecraft.getInstance().player; if (localPlayer != null && event.getEntity() instanceof Mob mob) { if (/* put your own condition here */) { if (!renderingCustomEntity) { try { renderingCustomEntity = true; event.setCanceled(true); refreshCustomEntity(localPlayer, mob); // (truth be told, my custom entity does not have a "head", so these lines aren't needed) // customEntity.setYHeadRot(mob.getYHeadRot()); // customEntity.yHeadRotO = mob.yHeadRotO; customEntity.setYBodyRot(mob.yBodyRot); customEntity.yBodyRotO = mob.yBodyRotO; customEntity.setPose(mob.getPose()); Minecraft.getInstance().getEntityRenderDispatcher().getRenderer(customEntity).render( customEntity, customEntity.yBodyRot, event.getPartialTick(), event.getPoseStack(), event.getMultiBufferSource(), event.getPackedLight() ); } finally { renderingCustomEntity = false; } } } } }   As shown in my code, if the mob whose model is replaced moves to a different dimension, I unload the custom entity with Entity#discard and then reinitialize it on the next tick. I wonder if I also have to unload the custom entity when the mob it is "replacing" dies.
    • Thank you for the video, but I found the issue. I had to update the Gradle from 7.2 to 7.3 in gradle/wrapper/gradle-wrapper.properties.
    • Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
    • Whenever i try and download forge specifically 1.18.2 it will download as a JAR file as a note page and theirs no way to install it i have watched a few videos but none show how to fix this problem
    • Hello, I dont really understand why the nbt tag in the code below is not attached to the item. @Override public InteractionResult interactLivingEntity(ItemStack pStack, Player pPlayer, LivingEntity pInteractionTarget, InteractionHand pUsedHand) { if (pPlayer.getLevel().isClientSide()) { if (pInteractionTarget instanceof Mob mob) { System.out.println("ITEMSTACK " + pStack); CompoundTag nbtTag = null; System.out.println("nbt tag " + nbtTag); if (!(pStack.hasTag())) { nbtTag = new CompoundTag(); CompoundTag nbtMobTag = new CompoundTag(); mob.save(nbtMobTag); nbtTag.put("mob", nbtMobTag); System.out.println("IN NBT NULL " + nbtTag); pStack.setTag(nbtTag); System.out.println("AFTER TAG SET " + pStack.hasTag()); pPlayer.sendMessage(new TextComponent("Shard used on " + mob.getDisplayName().getString()), pPlayer.getUUID()); } else { nbtTag = pStack.getTag(); System.out.println("item has tag"); System.out.println(nbtTag.contains("mob")); } } } return InteractionResult.PASS; } @Override public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) { CompoundTag nbtTag = pStack.getTag(); if (nbtTag != null) { if (nbtTag.contains("mob")) { Mob targetMob = null; targetMob.deserializeNBT(nbtTag.getCompound("mob")); pTooltipComponents.add(new TextComponent("Mob : " + targetMob.getDisplayName().getString())); } } } Everytime I right click with the Item on a LivingEntity, It goes on the if(!pStack.hasTag()), but It shouldn't because we set the tag on the first right click on an Entity   Do you have a solution ?
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.