Jump to content

Recommended Posts

Posted

For some reason i don't know, minecraft/forge cannot find the files for the models for my blocks.

I get this message: 

Unable to load model: 'winnetriesexpansionmod:block/black_stained_clay' referenced from: winnetriesexpansionmod:black_stained_clay#: java.io.FileNotFoundException: winnetriesexpansionmod:models/block/black_stained_clay.json

I checked like 100 times, but the file is there in that folder, yet it still keeps saying "filenotfoundexception"

 

I don't know what to do

Posted

Is the code on your GitHub up to date?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Posted

Alright. I have only 1 block enabled in my mod for the sake of testing.

This is what i have so far:

blockstate:

{
    "variants": {
        "": { "model": "winnetriesexpansionmod:block/black_stained_clay" }
    }
}

 block model:

{
    "parent": "block/cube_all",
    "textures": {
        "all": "winnetriesexpansionmod:blocks/black_stained_clay"
    }
}

item model:

{
    "parent": "winnetriesexpansionmod:block/black_stained_clay",
    "display": {
        "thirdperson": {
            "rotation": [-90,0,0],
            "translation": [0,1,-3],
            "scale": [0.55,0.55,0.55]
        },
        "firstperson": {
            "rotation": [0,-135,25],
            "translation": [0,4,2],
            "scale": [1.7,1.7,1.7]
        }
    }
}

All 3 files are called black_stained_clay.json

 

This is what appears in the log:

[09aug2019 20:55:15.459] [Server-Worker-2/WARN] [net.minecraft.client.renderer.model.ModelBakery/]: Unable to load model: 'winnetriesexpansionmod:block/black_stained_clay' referenced from: winnetriesexpansionmod:black_stained_clay#: java.io.FileNotFoundException: winnetriesexpansionmod:models/block/black_stained_clay.json
[09aug2019 20:55:15.931] [Server-Worker-2/WARN] [net.minecraft.client.renderer.model.ModelBakery/]: Unable to load model: 'winnetriesexpansionmod:black_stained_clay#inventory' referenced from: winnetriesexpansionmod:black_stained_clay#inventory: java.io.FileNotFoundException: winnetriesexpansionmod:models/item/black_stained_clay.json

 

There are no other errors or relevant problems.

 

This is how i register the block:

@EventBusSubscriber(modid = References.MOD_ID, bus = EventBusSubscriber.Bus.MOD)
public class ModRegistry {
	
	@SubscribeEvent
	public static void onItemRegister(RegistryEvent.Register<Item> event) {
		
		System.out.println("Registering all items");
		
		//REGISTERING ALL ITEMBLOCKS
		for (Block block : ForgeRegistries.BLOCKS.getValues()) {
			
			if (block.getRegistryName().getNamespace().equals(References.MOD_ID)) {

			    event.getRegistry().register(new BlockItem(block, new Item.Properties().group(Utilities.WINNETRIESEXPANSIONMOD)).setRegistryName(block.getRegistryName()));
			}
		}
	}
	
	@SubscribeEvent
	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
	
		System.out.println("Registering all blocks");
		
		//REGISTERING ALL BLOCKS
		event.getRegistry().registerAll(
		ModBlockReference.black_stained_clay = new Block(Block.Properties.create(Material.CLAY, MaterialColor.BLACK_TERRACOTTA).hardnessAndResistance(0.6F).sound(SoundType.GROUND)).setRegistryName(new ResourceLocation(References.PREFIX + "black_stained_clay"))
         );
	}
}

 

Posted (edited)

By the way, you can really simplify your item model:

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/assets/harderores/models/item/sifter.json

There is literally no reason ever (almost) to actually override the display tag.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
4 hours ago, winnetrie said:

Yes i know that, i needed it some long time before and never got rid of it. Anyway that doesn't solve my problem.

All blocks are still purple/black squares and the game still doesn't find any (block and item) models for those blocks

 

Are you using IntelliJ IDEA?

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.

Posted (edited)
On 8/9/2019 at 12:12 PM, winnetrie said:

for (Block block : ForgeRegistries.BLOCKS.getValues()) {

First off this is just horrible. Create your own set of Blocks to loop through don't use the registry.

6 minutes ago, winnetrie said:

Has something changed about that? Because you ask

Not sure which part you're asking about.

 

6 minutes ago, winnetrie said:

Only the for the blocks it can't find model files

Show your models.blocks in the screenshot too.

And give us the latest log.

Edited by Animefan8888

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.

Posted (edited)

You asked me about the package, i gave you a screenshot and i asked you if something changed about it. Like is it different now then in 1.12.2.

 

I gave you my latest log. There are only 2 lines relevant. There is nothing else in the log, just the usual stuff in every log.

 

I used the registry, because i was told to do so. I had my own stuff before (a list), but i was told not to use that because it was redundant. 

 

What do you want to see about the models.blocks? It is too long to fit in a screenshot.

They are just filenames like for example  "somename.json"

 

I made a fresh log for you: log

 

Edited by winnetrie
Posted

The screenshot you shared is useless because you did not expand the blocks and items directories to show the files inside them. I know you said that they're named "black_stained_clay.json", but we can't actually see that.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
1 hour ago, winnetrie said:

What do you want to see about the models.blocks? It is too long to fit in a screenshot.

14 minutes ago, Draco18s said:

The screenshot you shared is useless because you did not expand the blocks and items directories to show the files inside them. I know you said that they're named "black_stained_clay.json", but we can't actually see that.

What he said ^^^
 

1 hour ago, winnetrie said:

I used the registry, because i was told to do so. I had my own stuff before (a list), but i was told not to use that because it was redundant. 

Well whoever told you to do that was wrong. Imagine a user with a 100+ mods. Where each of those mods adds a decent sum of blocks all looping through the Blocks Registry to create their BlockItems. That's just ridiculous.
 

1 hour ago, winnetrie said:

You asked me about the package, i gave you a screenshot and i asked you if something changed about it. Like is it different now then in 1.12.2.

I asked to see it for spelling errors we all make them.

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.

Posted (edited)

I just wanted to make a new screenshot and discovered the folder where the block models are, is empty....?. I don't understand why it is empty. All files are gone. I'm pretty sure i didn't deleted it. So i made 1 new file for the that 1 block model and now it works properly. I Really don't know what to say. I have been trying to make this work for a whole week, modifying the files over and over again to test this and that. I really wonder what i modified all the time when the folder is empty....

 

It's working now, so thank you for your time.

Btw it seems that creating a blockstate file with a forge marker doesn't work anymore. Or not that i know anyway. So now i have to create all files. 1 blockstate, 1 block model and 1 item model for each block i add to the game. Lot's of work, but i'll get there

Edited by winnetrie

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

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.