Jump to content

Recommended Posts

Posted

Hey guys, I'm just starting out to learn Minecraft modding and for some reason my block isn't loading.

I'm going through the errors and it seems that these errors tell me why:

[m[33m[17:49:38] [Worker-Main-11/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testmod:blockstates/ruby_ore.json' in resourcepack: 'Mod Resources' for variant: 'normal': Unknown blockstate property: 'normal'
[m[33m[17:49:38] [Worker-Main-11/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testmod:blockstates/ruby_ore.json' missing model for variant: 'testmod:ruby_ore#'
[m[33m[17:49:39] [Worker-Main-11/WARN] [minecraft/ModelBakery]: Unable to load model: 'testmod:ruby_ore#inventory' referenced from: testmod:ruby_ore#inventory: java.io.FileNotFoundException: testmod:models/item/ruby_ore.js

As you can tell, I am trying to add "ruby's" to the game and have succeeded in just adding rubies but am not having much luck on the block side.

Here is the code for how I registered the block,

	@SubscribeEvent
	public static void onRegisterBlocks(RegistryEvent.Register<Block> event) {
		Block ruby_ore = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(
				0.6F, 6.0F).sound(SoundType.STONE));
		
		event.getRegistry().registerAll(
				setup(ruby_ore, "ruby_ore")
		);
		// new BlockItem(
		//		ruby_ore, new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP)).setRegistryName(ruby_ore.getRegistryName());
	}
	@SubscribeEvent
	public static void onRegisterBlockItem(RegistryEvent.Register<Item> event) {
		BlockItem ruby_ore = new BlockItem(
				ModBlocks.RUBY_ORE, new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP));
		event.getRegistry().registerAll(
				setup(ruby_ore, "ruby_ore"));
	}
	public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final String name) {
		return setup(entry, new ResourceLocation(testmod.MODID, name));
	}
	
	public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final ResourceLocation registryName) {
		entry.setRegistryName(registryName);
		return entry;	
	}

My ObjectHolder class for all my blocks:

@ObjectHolder(testmod.MODID)
public class ModBlocks {
	public static final Block RUBY_ORE = null;
}

and my file structure:

image.png.ae18e95fa3fc9473ed342ed001f07b74.png

From the error it seems simply that my variants object is off because it seems to have "normal" as its key, but that isn't true.

Here is my testmod.blockstates.ruby_ore.json

{
    "variants": {
        "": { "model": "testmod:block/ruby_ore" }
    }
}

My testmod.models.block.ruby_ore.json

{
    "parent": "block/cube_all",
    "textures": {
        "all": "testmod:blocks/ruby_ore"
    }
}

and of course my testmod.item.ruby_ore.json

{
    "parent": "testmod:block/ruby_ore"
}

 Anyways hoping anyone can help me find the cause of my error! :D

Posted
1 minute ago, poopoodice said:

I'm not sure if this is the setting of your IDE but ASSETS should not be capitalized.

Yeh that's just how VSCode displays the parent folder not what I named the folder itself. :D

 

Posted
2 minutes ago, poalqo said:

Yeh that's just how VSCode displays the parent folder not what I named the folder itself. :D

 

Good to know.

Your structure and json files looks fine, is it possible for you to upload a repo?

Posted
Just now, poopoodice said:

Good to know.

Your structure and json files looks fine, is it possible for you to upload a repo?

Is there a way to share a repo privately? (I assume on GitHub)

Posted (edited)

I don't think you can (beside gists), but you can always remove the link here or make the repo private afterwards.

 

I can't guarantee that I can fix your problem tho.

Edited by poopoodice
Posted
18 minutes ago, poalqo said:

"variants": { "": { "model": "testmod:block/ruby_ore" } }

I'm bad at JSONs, but as far as I see, here is no

 

18 minutes ago, poalqo said:

'testmod:blockstates/ruby_ore.json' in resourcepack: 'Mod Resources' for variant: 'normal'

 

Everything said above may be absolutely wrong. No rights reserved.

Posted
1 minute ago, poopoodice said:

I don't think you can (beside gists), but you can always remove the link here or make the repo private afterwards.

 

I can't guarantee that I can fix your problem tho.

Ok I might create a repo and make it private afterwards

Posted (edited)
2 minutes ago, poalqo said:

What do you mean "here is no"?

I'm not sure, but it looks like minecraft is searching for modelblockstate variant "normal", but you do not specify it.

Edited by Dzuchun

Everything said above may be absolutely wrong. No rights reserved.

Posted
Just now, Dzuchun said:

I'm not sure, but it looks like minecraft is searching for model variant "normal", but you do not specify it.

But then why would it say:

Unknown blockstate property: 'normal'

?

Posted
1 minute ago, poopoodice said:

 

It works totally fine in my dev environment. There must be something messed up with yours, you may want to recreate all folders...etc.

image.png.3d829dc5c0eb0d97a04907cc074b33cf.png

 

Wow...I might just redownload my own repo, and rebuild my thing lmaooo. thanks!

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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