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.12.2] Can't get custom block texture to load when placed, but inventory works

Featured Replies

Posted

I can't seem to understand why this isn't working, but I put .png textures for a block I'm trying to insert into the game. In the hotbar, it shows up perfectly, but when I place the block it does not load the texture, despite tinkering with the JSON files I created for them.

 

I have attached my Mod File, as well as my .java files where I register all blocks/items/itemBlocks, and my .JSON files used for models.

 

Mod File: https://pastebin.com/J9Bv21AR

My EventSubscriber.java where I register items/blocks: https://pastebin.com/LuYnNB5K

ModBlocks.java file: https://pastebin.com/aEhUKpqE

My HealthBox.java file: https://pastebin.com/ny3fFkac

JSON file located in assets.modname.models.block: https://pastebin.com/1iHBkVFA

JSON file located in blockstates: https://pastebin.com/33BH4Hc1

Logs Logs Logs: https://pastebin.com/sQbXpRhe

2019-08-13_20.35.12.png

Screenshot from 2019-08-13 20-44-11.png

Edited by dbz0wn4g3

53 minutes ago, dbz0wn4g3 said:

JSON file located in blockstates:

Your textures tag isnt needed your model specifies the texture.

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.

  • Author
11 minutes ago, Animefan8888 said:

Your textures tag isnt needed your model specifies the texture.

Done, still having the same error and logs are more or less the same (nothing extraordinary changed). Do you think it may be an error in my package structure?

3 minutes ago, dbz0wn4g3 said:

Done, still having the same error and logs are more or less the same (nothing extraordinary changed). Do you think it may be an error in my package structure?

Post the debug log or the straight console there should be an error.

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.

  • Author

Solved!

 

What I had done before was register a new HealthBox(), when I had already declared one in code.

 

To fix this, I changed "new HealthBox()" in EventSubscriber to "ModBlocks.HEALTH_BOX" (which references a new HealthBox in code via ModBlocks.java).

4 minutes ago, dbz0wn4g3 said:

Solved!

 

What I had done before was register a new HealthBox(), when I had already declared one in code.

 

To fix this, I changed "new HealthBox()" in EventSubscriber to "ModBlocks.HEALTH_BOX" (which references a new HealthBox in code via ModBlocks.java).

A better solution would be to do this instead.

// Change
public static final HealthBox HEALTH_BOX = new HealthBox();
// TO
@ObjectHolder("modid:registry_name")
public static final Block HEALTH_BOX = null;

And keep the new HealthBox in your Registry Event.

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.

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.