In this guide we'll cover how to:
- Add skins to an animal
- Add hunt targets to an animal
- Add herd targets to an animal
- Add scared targets to an animal
Folder Structure
You could use a plain datapack + resource-pack, but for simplicity we'll use a JS-addon.
[addon_name]/addon_data/data/data/[addon_name]/pack.mcmetaresources/assets/[addon_name]/pack.mcmeta
警告
I won't reference pack.mcmeta anymore from this point forwards, it should still be there.
We'll not use the addon_data/ folder here, so you can leave it out.
Inside the data folder we'll start adding the necessary folders.
[addon_name]/addon_data/data/data/[addon_name]/animal_modifiers/[animal_you_want_to_edit].jsonresources/
Fields
| Field | Type | Required | Description |
|---|---|---|---|
animal | string | Required | Resource key of the animal to edit |
add_genes | string[] | Optional | List of skin gene resource keys to add to the animal |
gendered_variants | string[] | Optional | Genes from add_genes that have gendered variants |
herd_targets | string[] | Optional | List of animal resource keys to add as herd targets |
hunt_targets | string[] | Optional | List of animal resource keys to add as hunt targets |
scared_off | string[] | Optional | List of entity resource keys to add as scared targets |
{"animal": [String],"add_genes": [String[]],"gendered_variants": [String[]],"herd_targets": [String[]],"hunt_targets": [String[]],"scared_off": [String[]]}
That's how you modify an animal, pretty simple right?
Let's now make sure the textures work.
Let's go back to the start
So the way this works is, you've edited an animal with an identifier, which is namespace:path.
We'll have to remember both, we'll also have to look ingame which version the animal is from, which is usually mentioned on the spawn egg under the item title if you hover over it.
[addon_name]/addon_data/data/resources/assets/[namespace]/textures/geo/animal/[version]/[path]/variants/
That might seem a bit complex, but it's pretty easy if you look at it!
Let's now see what gene(s) we've added.
Depending on if we have added the same gene in gendered_variants, the texture file should be named appropriately:
(To make an existing gene gendered, add it to both add_genes and gendered_variants)
gendered_variants:
2 files:
- Male ->
[path]_adult_[gene_name]_male.png - Female ->
[path]_adult_[gene_name]_female.png
Otherwise, just one file -> [path]_adult_[gene_name].png
...[version]/[path]/variants/[files]
That's actually all it takes!