#Which format should I use if i were to make models for datapacks?

25 messages · Page 1 of 1 (latest)

worn pollen
#

Question's in the title already.
Also wanna know the methods I can also export in, for both custom items and mobs

wooden wigeon
#

Data packs have nothing to do with models (directly), so please rephrase the question.

worn pollen
#

I saw some videos where they use blockbench to make models to load in datapacks no?

#

Something like this for example:
https://www.youtube.com/watch?v=aaJ8XgMAOno

This is the third episode of the series where I show you how to use Blockbench to create custom models and textures for your item. In the last two episodes, I went over how to choose your item and give it to yourself with mcstacker.net, and I went over how to give your item a custom ability.

In future videos, I will go over ways to craft your i...

▶ Play video
#

I'm very new to this datapack thing so I might get confused with things

wooden wigeon
#

to load in datapacks no?
they might use a datapack to get the specific items easier, but the models are neither part of the data pack nor do they require one

#

the most a data pack can do is give you an item with some specific data (which you can do with a /give command in chat too)

worn pollen
#

oh, then how do they load in custom models then?

wooden wigeon
#

with a resource pack

worn pollen
#

and i assume its format uses something like java block/item?

wooden wigeon
#

the model itself is a completely normal java/block item model

#

The model file to tell the game to use model X when criteria Y is met is like this:

#

!faq custom_model_data

latent daggerBOT
# wooden wigeon !faq custom_model_data

Disclaimer: This only works for items (not placed blocks!) and only if you are in Java Edition 1.14 or later!

Example to give a stick 4 new models:
You'd place this file in YourResourcePack/assets/minecraft/models/item and call it stick.json.

stick.json

{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/stick"
    },
    "overrides": [
        { "predicate": {"custom_model_data": 1}, "model": "item/custom_stick"},
        { "predicate": {"custom_model_data": 2}, "model": "custom/branch"},
        { "predicate": {"custom_model_data": 3}, "model": "block/stone"},
        { "predicate": {"custom_model_data": 4}, "model": "item/more_sticks"}
    ]
}```
Ingame you can give yourself one of the custom sticks by doing `/give <player> stick{CustomModelData:X}` (X being replaced by the number you want)

*PS: The model path is **always** relative to the models folder of your pack.*
*So `"item/custom_stick"` will load the model in `YourPack/assets/minecraft/models/item` called custom_stick.json.*
*For `"custom/branch"` it would be the model in `YourPack/assets/minecraft/models/custom` called branch.json and so on.*
wooden wigeon
#

if you don't wanna bother with typing .json code you can also copy the default model for the item you wanna use into your pack, open it in Blockbench and then define the custom_model_data stuff in Blockbench

#

(keep in mind that the stick.json (or whatever item you will use) is a completely separate file from the custom models you "add" onto it)

#

(you can do that in Tools > Edit Predicate Overrides)

worn pollen
#

recapping it a bit, so if i wanna make models used with datapacks. i just need to:

  • use a resource pack to load the custom models
  • use java block/item format to make said models
  • export it as a .json file and give it to the dudes who'll handle the resource pack part

thats assuming im just doing the modeling part only, without messing with resource packs (just yet i guess)

wooden wigeon
#

yes

worn pollen
#

ahh ok

#

thank you very much

wooden wigeon
#

well

#

it would be better if you give them the .bbmodel file (File > Save Project)

#

that way they have the texture and model in one

#

(and the .json file would have some texture path leading to some place they don't have on their device)