#How to load the block model and texture

42 messages · Page 1 of 1 (latest)

atomic rapids
#

can't seem to get the model and texture to work, been following a tutorial to add blocks through modding but they didn't use a blockbench model so I couldn't follow the whole way through. I've checked multiple times and everything seems to be in the right place but the model of the block doesn't load

daring prismBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

still ivy
atomic rapids
#

nope, client runs fine, and world loads with no problems but neither model and texture load since it appears as black and purple block in both my hand and when placed

still ivy
#

Hmm, there should be at least one error when there is an error cube model 🤔

atomic rapids
atomic rapids
#

can items/blocks only be -45/-22.5/0/22.5/45 any of these 4 rotations?

shell valve
atomic rapids
#

I assume this is the case for 1.20.1?

shell valve
#

yes

atomic rapids
#

welp, that kinda sucks

#

I assume this is either changed in a more recent version?

atomic rapids
#

model is working now but what do I do about the dead pixels and how do I fix the wallhack thing

#

also how do I make it face Me when I place it down, currently it only faces north when placed

sage brook
#

!faq java culling

daring prismBOT
# sage brook !faq java culling
FAQ
Java: Culling

Minecraft hides (culls) the faces between solid blocks to improve performance. To avoid this, remodel a non-solid block. For example: Glass, Pressure Plates, Flowers.
Alternatively, display the model by putting it into the head slot of an invisible Armor Stand or inside an invisible Item Frame, or by using the new Item Display entity.

sage brook
#

To make it face you: You'll need to add some blockstate values to it that change depending on what direction you face when placed, and specify a different rotation value for the model depending on what blockstate it's using

still ivy
#

And instead of a new Block() you'd make a new HorizontalBlock() so you don't need to code in the rotation behavior etc. (You'd still need to make the blockstate file for the pack ofc)
-# not 100% sure on the class name. Might be DirectionalBlock or similar.

#

As for rendering, if I'm not mistaken it would be something like
ItemBlockRenderTypes.setRenderLayer(SEATTLE_PLUSHIE.get(), RenderType.translucent());
in some client setup event function.

atomic rapids
#

thank you, gonna have to start looking into all of this

still ivy
#

Alternatively in Forge you can also specify it in the model.

#

So if you add "render_type": "cutout", to the root of your model it should work too without the client setup event function part there

atomic rapids
#

dead pixel problem has been solved but culling faces is a bit confusing. since culling faces for the model affects my block and not the nearby blocks I can't seem to stop the game from culling the faces of nearby blocks when placed on my block

atomic rapids
#

update, managed to fix the culling by having it share properties with glass

atomic rapids
#

I'm stumped, I can't get the block states working

#

[17:35:30] [Worker-Main-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'warspiteswordmod:blockstates/seattle_plushie.json' in resourcepack: 'mod_resources' for variant: 'facing=east': Unknown blockstate property: 'facing'
[17:35:30] [Worker-Main-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'warspiteswordmod:blockstates/seattle_plushie.json' in resourcepack: 'mod_resources' for variant: 'facing:south': Unknown blockstate property: 'facing:south'
[17:35:30] [Worker-Main-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'warspiteswordmod:blockstates/seattle_plushie.json' in resourcepack: 'mod_resources' for variant: 'facing:west': Unknown blockstate property: 'facing:west'
[17:35:30] [Worker-Main-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'warspiteswordmod:blockstates/seattle_plushie.json' in resourcepack: 'mod_resources' for variant: 'facing=north': Unknown blockstate property: 'facing'
[17:35:30] [Worker-Main-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'warspiteswordmod:blockstates/seattle_plushie.json' missing model for variant: 'warspiteswordmod:seattle_plushie#'

#

it just keeps giving Me these errors

shell valve
atomic rapids
#

well that's what I don't understand cuz I did make the blockstates, and I think I correctly did the DirectionalBlock Class which I just stole from another mod

shell valve
#

show the f3 screen when you are looking at the block in game

atomic rapids
shell valve
#

that block has no blockstates

#

if you look at a block that can rotate, you should see it listing the blockstates there

atomic rapids
#

oh, I see

#

just to confirm, this should be new DirectionalBlock correct?

shell valve
#

idk, i dont mod

atomic rapids
#

oh

#

GOOD NEWS!

#

got it to work, I referenced the wrong block class, that's why. manage to turn off ambient occlusion as well