-
Notifications
You must be signed in to change notification settings - Fork 0
Adding Custom Item Models
Important
Make sure you have completed getting started before going any further!
All pages from this point onward involve editing your own pack repository & assets.
All custom items using rebar have a custom id, for example the bronze ingot from pylon has an id of pylon:bronze_ingot, similar to how all Minecraft items have an id such as minecraft:iron_ingot. Rebar items will always have a [custom model data string] with their custom id. Resource packs can check the custom model data strings, and use it to change the model rendered, for example, to make a copper ingot use our own custom bronze ingot model.
Similarly lots of rebars gui items will do the same, they include a custom model data string to identify them.
More complicated items may have additional custom model data, but for now we will just focus on simple item models.
You can assume if it says to put <something>.json under input/assets/<addon>/<some_folder> that you can put the file under subfolders of <some_folder>/ as well.
Anytime you are wanting to give a rebar item a custom model/texture, the first step is to create the rebar item definition.
A rebar item definition is a .json file that stores data about the rebar item you are adding a custom model for.
In getting started you should have made a folder at input/assets/<addon>/, all rebar item definitions fall under input/assets/<addon>/items/.
-
Create the definition file for your rebar item at
input/assets/<addon>/items/<id>.json, for example, the bronze ingot from pylon would beinput/assets/pylon/items/bronze_ingot.json. -
Copy & paste the json below into your newly created file, all definitions will have different contents, but they all start from the same place.
{
"author": "AUTHORS_NAME",
"vanilla": "minecraft:<item_id>"
}"author" is an optional field where you can give credit to whomever made the model/textures for the item.
"vanilla" is a required field which should be set to the vanilla item model used by the pylon item.
Note
If you don't know the vanilla item model for a rebar item, turn off all resource packs
and look at the rebar item. Whatever vanilla item you see is the vanilla item model.
If you see a diamond, the id would be "minecraft:diamond", if you aren't sure what the id
of the item is, use advanced tooltips and look at the vanilla item, not the rebar item.
and there will be a small gray line formatted like "minecraft:<id>", that is your vanilla item model
For example, the bronze ingot for pylon looks like this (Click to expand/collapse)
{
"author": "Pandicka",
"vanilla": "minecraft:copper_ingot"
}Note
If for some reason you cannot name the file after the id of the item
then you can manually define the id inside of the definition json
under "id": "<whatever-the-id-is>". You might need to do this
if it contains characters unsupported in file names, or if there
is a collision of id's somehow.
After you've created & setup the first 2 parts of your rebar item definition, you'll setup the model.
If you're unsure what kind of model you're using, check out Generated 2d Model first.
Note
If you're making/using vanilla styled 2d item textures for armor pieces,
you should also check out Custom Armor Textures
Most pylon items won't require anything more than a simple individual texture. If that's all you need, here's how to do it.
- First you need to actually get your texture, whether you're making it yourself, a friend's making it, whatever, you just need to actually get your item texture, specifically in
.pngformat. If it isn't a.pngthere are lots of online converters you can use to make it such. - After you have your texture, you need to put it under the item textures folder,
input/assets/<addon>/textures/item/with the same name as your rebar item definition.
a. If your definition is under any subfolders, its recommended to put the texture under the same folders, but it is not required.
b. This is the same place you normally put item textures, the important part is that it has the same name as your rebar item definition.
For example, a definition at
input/assets/pylon/items/bronze_ingot.jsonwould have a texture atinput/assets/pylon/textures/item/bronze_ingot.png
And that's all it takes, no need to create a dedicated model file or define anything else in your definition, as long as you have a texture .png with the same name as the item definition, the generator will do the rest of the work for you.
Next you may want to continue Adding Assets or go on to Pack Generation
Some pylon items you may want a custom model file for, such as 3d items, dyeable items, etc. Basically anything that requires more than a singular texture model, but doesn't require custom model logic, falls under the Simple Model category. If you need to do any custom item model definition related things, see Advanced Model, otherwise, here's how to do it.
- First, create your item model and any texture's you need, Blockbench is a tool made by the creators of Minecraft that can help you do that.
This should be a
.jsonfile and.pngtexture(s) (if any are needed). a. When making the model make sure you save any of the textures somewhere under theinputs/assets/<addon>/textures/item/folder - Put the item model under
input/assets/<addon>/models/item/a. You can name the model whatever you want but it's recommended to name it the same as your rebar item definition
If your model has the same id/name as the rebar item definition, you don't need to do anything further, the generator will detect that the model exists and use it for the rebar item definition.
For example, a definition at
input/assets/pylon/items/bronze_cannon.jsonand model atinput/assets/pylon/models/item/bronze_cannon.json
If your model does not have the same id/name ad the definition, then you need to add an explicit reference to your rebar item definition of "model": "<addon>:item/<model_path>"
For example, a definition of
input/assets/pylon/items/bronze_cannon.jsonwith a model atinput/assets/pylon/models/item/my_bronze_cannon.jsonWould look like so:{ "author": "AnAuthorsName", "vanilla": "minecraft:copper_horse_armor" "model": "pylon:item/my_bronze_cannon" }
After adding the model reference to your definition (if necessary), you're done! Now you may want to continue Adding Assets or go on to Pack Generation
If you need an item model for a model that also has a block model, you may be able to just use the block model for the item model. If you have a block model already defined under the same id/name as your rebar item definition, then the generator will automatically use it for the item. No additional work necessary.
For more complex items, like items with use animations (think a crossbow, spyglass, etc), you may want/need to use an advanced model that takes advantage of item model definitions. For an example on a real item that uses this, see the confetti popper from pylon.
- First actually create whatever models, textures, and item model definition you need for the rebar item, and move the models & texture files under the input folder and the normal resource pack folder structure. (
input/assets/<addon>/models/item/andinput/assets/<addon>/textures/item - Then go back to your rebar item definition and add a new empty json object under
"model". It should look something like this:
{
"author": "AnAuthorsName",
"vanilla": "minecraft:<vanilla_item_model>"
"model": {
}
}- Finally just paste your vanilla item model definition in there, for example, the confetti popper looks something like this:
Confetti Popper Rebar Item Definition (Click to Expand/Collapse)
{
"author": "Pandicka",
"vanilla": "minecraft:firework_rocket",
"model": {
"type": "condition",
"property": "using_item",
"on_false": {
"type": "model",
"model": "pylonbase:item/tools/confetti_popper"
},
"on_true": {
"type": "select",
"property": "display_context",
"cases": [
{
"model": {
"type": "model",
"model": "pylonbase:item/tools/confetti_popper"
},
"when": ["gui", "ground", "fixed"]
}
],
"fallback": {
"type": "model",
"model": "pylonbase:item/tools/confetti_popper_charged"
}
},
"fallback": {
"type": "model",
"model": "pylonbase:item/tools/confetti_popper"
}
}
}The generator will automatically use the specified item model definition for your rebar item.
Next you may want to continue Adding Assets or go on to Pack Generation