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

'Missing Model for variant' on a block that has no variants.


Arkevorkhat
 Share

Recommended Posts

(Code repository to be referenced: https://github.com/codycoolwaffle/Steamworks )
I've created a simple block (following the docs, file src/main/java/waffletopia/steamworks/common/block/ore.java)
whenever I launch the development client, I get a pair of warnings:
 

[00:59:48] [Server-Worker-4/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'steamworks:blockstates/ore_zinc.json' missing model for variant: 'steamworks:ore_zinc#'
[00:59:48] [Server-Worker-4/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'steamworks:blockstates/ore_zinc.json' in resourcepack: 'Mod Resources': Neither 'variants' nor 'multipart' found


This would be fine, but my code doesn't define *any* variants, especially not one named #.
I get a java.io.FileNotFound exception instead if I don't include a blockstates/ore_zinc.json file, and even then, no texture appears on the block.

In case it's of any relevance, the BlockItem for the zinc ore block *does* successfully find and use the texture that I supplied for it.

 

Any thoughts?

Link to comment
Share on other sites

  • Do not create blocks, items or any registry entries in a static initializer. Use the proper registry events or DeferredRegister.
  • If your block doesn't have any variants it can't display anything. You need to specify the empty variant with a model, otherwise Minecraft has no idea how to render your block. Look at vanilla block states for simple blocks for examples.
  • Confused 1
Link to comment
Share on other sites

OK, let's say you were in a position where you *weren't* more inclined to chastise me for code style than actually do anything to help:
where, pray tell, would I be expected to be able to find a copy of the vanilla minecraft code for defining blocks, when the entire reason that forge exists is that minecraft code is obfuscated to the point of being impossible to work with?

Link to comment
Share on other sites

1 minute ago, Arkevorkhat said:

OK, let's say you were in a position where you *weren't* more inclined to chastise me for code style than actually do anything to help:

It's not about code style. I was pointing out a problem with your code that will cause you problems don't the line. No "chastising" of you, your code or your code-style has taken place.

 

2 minutes ago, Arkevorkhat said:

where, pray tell, would I be expected to be able to find a copy of the vanilla minecraft code for defining blocks

It's not code, it's JSON files. You find them by using the "find file" function of your IDE. In IntelliJ that would be Ctrl-Shift-N. I don't know about Eclipse because i don't use it, but I am sure it has similar functionality.

 

5 minutes ago, Arkevorkhat said:

when the entire reason that forge exists is that minecraft code is obfuscated to the point of being impossible to work with?

That is not the reason Forge exists. The reason Forge exists is that if everyone were to just modify the class files ("jarmodding") like it used to be in the very old days mods would be incompatible with each other all the time.

And in fact Forge uses MCP's data to deobfuscate Minecraft code to the point of it being quite usable. Not pretty, but usable.

Link to comment
Share on other sites

You should post your entire debug.log, and not cherry pick it as there can be things in there that could be related that you are omitting without realizing it.

 

Also your textures/blocks folder should be named block instead of blocks (I believe this was one of the 1.13 rewrite changes). That could be why you were getting a missing texture at on point like you mentioned.

 

*edit: and in your blockstate, you need to specify at least 1 state for the block, if there's no variants use empty "", and it must specify a model for that state, and you have empty curly braces.

 

The vanilla blockstates, if you wish to reference them, are in the client-extras jar in your IDEs referenced libraries.

Edited by Ugdhar
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

    • Forge's custom networking is built on the custom payload packet. You can either use a SimpleChannel (which uses a byte-indexed codec, so you have to handle that on the bukkit side, too) or you can use an EventChannel, which just gives you access to the raw payload packet data.
    • [16:08:43] [main/ERROR] [LaunchWrapper]: Unable to launch java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_292] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_292] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292] 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_292] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_292] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292] at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70) [forge.jar:?] at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34) [forge.jar:?] Caused by: java.lang.VerifyError: Operand stack overflow Exception Details: Location: net/minecraft/entity/EntityLivingBase.func_70088_a()V @7: aload_0 Reason: Exceeded max stack size. Current Frame: bci: @7 flags: { } locals: { 'net/minecraft/entity/EntityLivingBase' } stack: { 'net/minecraftforge/fml/common/eventhandler/EventBus', uninitialized 3, uninitialized 3 } Bytecode: 0x0000000: b201 09bb 010b 592a b701 0cb6 0112 572a 0x0000010: b401 16b2 0118 03b8 011e b601 242a b401 0x0000020: 16b2 0126 03b8 012b b601 242a b401 16b2 0x0000030: 012d 03b8 0132 b601 242a b401 16b2 0134 0x0000040: 03b8 012b b601 242a b401 16b2 0136 0cb8 0x0000050: 013b b601 24b1 at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_292] at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[?:1.8.0_292] at java.lang.Class.getConstructor0(Class.java:3075) ~[?:1.8.0_292] at java.lang.Class.getConstructor(Class.java:1825) ~[?:1.8.0_292] at net.minecraft.entity.EntityList.func_191303_a(EntityList.java:410) ~[vi.class:?] at net.minecraft.entity.EntityList.func_151514_a(EntityList.java:280) ~[vi.class:?] at net.minecraft.init.Bootstrap.func_151354_b(Bootstrap.java:505) ~[ni.class:?] at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:1470) ~[MinecraftServer.class:?] ... 12 more
    • 1.7 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • In the future please post the debug.log. I would recommend not using Performant. Delete the config file for better shields if you have not modified it. Note also that better shields does not use the Forge config system correctly. Report this to the mod author.
    • sorry downloaded forge itself not the mdk if you run into this problem, download the mdk from the download page, not forge itself
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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