Jump to content

[SOLVED] [1.12.2] Can't get custom block texture to load when placed, but inventory works


Recommended Posts

Posted (edited)

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
Posted
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?

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

Posted

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

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

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