Jump to content

[SOLVED] [1.16.1] Block texture visible in hand / inventory, but missing when placed in world.


RubyNaxela

Recommended Posts

Hello,
I've decided to update my old mod to 1.16.1 (actually I'm rewriting many things completely due to major changes in code in both Minecraft and Forge). But during the work, I encountered a really stupid problem. Like I said in the title, texture of every block is visible in any item slot, as well as in my hand. However when I place it down, the purple-black checker shows up. What can cause the problem?
 

Code details

The block is registered like this:

public static final RegistryObject<Block> SYLVITE_BLOCK = BLOCKS.register("sylvite_block", SylviteBlock::new);
public static final RegistryObject<Item> SYLVITE_BLOCK_ITEM = ITEMS.register("sylvite_block", () -> new BlockItem(SYLVITE_BLOCK.get()));

in registers:

public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MoleculeForce.MODID);
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MoleculeForce.MODID);

// Executed from main class
public static void init() {
  ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
  BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
}

 

models/block/sylvite_block.json

{
  "parent": "block/cube_all",
  "textures": {
    "all": "[modid]:blocks/sylvite_block"
  }
}

models/item/sylvite_block.json

{
  "parent": "[modid]:block/sylvite_block"
}

blockstates/sylvite_block.json

{
  "variants": {
    "normal": { "model": "[modid]:sylvite_block" }
  }
}

textures/blocks/sylvite_block.png
* exists and is valid if it works for blockitem *

Thanks in advance!

Edited by RubyNaxela
Link to comment
Share on other sites

@diesieben07 danke schön. I think you help the best way possible. You don't serve ready solution but make me do some research on my own with a brief couple of words. I appreciate that.
But anyway, back to the topic. The problem was indeed with loading the model, but not with the model itself. My blockstate file looked like this:

{
  "variants": {
    "normal": { "model": "[modid]:sylvite_block" }
  }
}

"normal" is not a recognized blockstate anymore and has to be empty. Furthermore, I addressed the model file wrongly. After corrections, it looks like this:

{
  "variants": {
    "": { "model": "[modid]:block/sylvite_block" }
  }
}

And now it works correctly.

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