Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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

  • Author

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.