2

I've been making a texture pack for a datapack in Minecraft 1.14.
In the .json file for the items (where I allocate the path for the textures I think), I've been using:

"parent": "item/template_spawn_egg",

but when I came to search for an issue with the spots, I found that they used a different parent:

"parent"   : "item/generated",

I saw this being used in various places online and I assumed they're for a specific type of item or something. But seeing it being substituted like this got me curious: is the parent 'generated' a handy catch-it-all term which I can use in place of a regular parent, or is it something else more complicated?

  • Maybe it's used for the colours of spawn eggs. – Fabian Röling Nov 16 '19 at 12:31
  • Well its not Fabian, the colours of the spawn eggs are hardcoded in, that however can be disabled in pack.mcmeta I think. – Joe Nov 17 '19 at 15:29
2

When you specify a parent model, the model you are currently creating will inherit properties from its parent.

This is especially useful if you are writing a custom model and you only want to modify one specific property of the model and keep all the other properties as default.

Example: this can be your main torch model (the parent) and let's call the file "torchModel.json"

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#torch"
    },
    "elements": [
       {   
           "from": [ 7, 0, 7 ],
           "to": [ 9, 10, 9 ],
           "shade": false,
           "faces": {
               "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#torch" },
               "up":   { "uv": [ 7,  6, 9,  8 ], "texture": "#torch" }
       }
   },
   {   
       "from": [ 7, 0, 0 ],
       "to": [ 9, 16, 16 ],
       "shade": false,
       "faces": {
           "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" },
           "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }
       }
   },
   {   
       "from": [ 0, 0, 7 ],
       "to": [ 16, 16, 9 ],
       "shade": false,
       "faces": {
           "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" },
           "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }
           }
   }
  ]
}

and now you can have a custom model which inherits all the properties from the parent model like this:

{
   "parent": "block/torchModel",
    "textures": {
       "torch": "block/torch"
     }
}

this custom model will use the torch block texture for the torch itself and it will still have the particles even though you didn't specify the particle property in the custom model file. The reason why it will have those particles is that they are specified in the parent file and the custom file is inheriting that property.

if you want a fully custom model with a custom shape and everything, you don't have to inherit from anything, you can just create the model from scratch, example:

{
    "credit": "Made with Blockbench",
    "textures": {
        "0": "blocks/beacon",
        "particle": "blocks/beacon"
    },
    "elements": [
        {
            "from": [0, 0, 0],
            "to": [1, 1, 1],
            "faces": {
                "north": {"uv": [0, 0, 1, 1], "texture": "#0"},
                "east": {"uv": [0, 0, 1, 1], "texture": "#0"},
                "south": {"uv": [0, 0, 1, 1], "texture": "#0"},
                "west": {"uv": [0, 0, 1, 1], "texture": "#0"},
                "up": {"uv": [0, 0, 1, 1], "texture": "#0"},
                "down": {"uv": [0, 0, 1, 1], "texture": "#0"}
            }
        }
    ]
}

I hope this made sense, it is hard to explain something like this through text. More info can be found on the Minecraft wiki: https://minecraft.gamepedia.com/Model

  • Oh I see, when you want to create a new texture without the properties of the said parent, you use "item/generated" in parent as it will act as a blank slate without any additional properties such as an image overlay (which I had issues with currently). When I used the "item/template_spawn_egg" as the parent it will inherit the properties meaning it could save time in creating the resource pack as it takes out the need to program those properties in. I got it thanks – Joe Nov 17 '19 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.