#Custom block with block states
44 messages · Page 1 of 1 (latest)
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.
so you want a specific note or instrument on the note block to use a custom model?
yes... I would like some tutorial step by step how I do this ...
do you have any experience with resource packs at all?
yes
ok good start, what kinds of things have you done
any custom block models?
I'm wondering if you need help on the model itself or just making it be used for certain noteblock blockstates
I made hats, custom chest and items (2D)
were those models or textures?
both
ok so making block models is basically the same as item models
they use the same format and everything
Okay, how can I get my custom block in the game?
what blockstates of the note block do you want this model to appear for?
well no matter the case you are going to need to create a blockstates file for it
a json file in "minecraft/blockstates" that sorta tells the game which models to use for a block
For example, this is the note block blockstates file in vanilla
"variants": {
"": {
"model": "minecraft:block/note_block"
}
}
}```
there is only a single model it uses by default
but you can change this
I need to make 2 blocks. So I need to change the block with some note?
ok, when do you want these blocks to appear?
like, on a certain pitch, a certain instrument?
or a combination of those
you have a lot of options to work with for note blocks, and any is fine
ok, I can make it change models when tuned to different notes
"variants": {
"note=1": {
"model": "minecraft:block/your_custom_block1"
},
"note=2": {
"model": "minecraft:block/your_custom_block2"
},
"": {
"model": "minecraft:block/note_block"
}
}
}```
here, you can change the "your_custom_block1" and 2 to whatever your models are named
(and if your models are not in minecraft/models/block then this file will have to be changed to reflect that file structure)
sure
And that folder we have the block states, where should this note block be?
the file I sent should be directly in there
yup, that's right
"variants": {
"note=1": {
"model": "minecraft:block/your_custom_block1"
},
"note=2": {
"model": "minecraft:block/your_custom_block2"
},
"note=0|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24": {
"model": "minecraft:block/note_block"
}
}
}```
here, this one's fixed
turns out I have to be more verbose in my definitions or Minecraft doesn't like it
wait no way I can make it do the same thing with fewer characters
I learn something new every day
"variants": {
"note=1": {
"model": "minecraft:block/your_custom_block1"
},
"note=2": {
"model": "minecraft:block/your_custom_block2"
},
"note=!1|!2": {
"model": "minecraft:block/note_block"
}
}
}```