Husbandry:Customisation

From Harvest Festival
Jump to navigation Jump to search

This page will explain how the data system for the mobs works. (It works with any MobEntity). It uses the Penguin-Lib Database so you will need to be used to working with that and with csv files. There are four components to understand. There are the mob_species.csv file which dictates all of the statistics of each mob such as their lifespan, maturity and products etc. There is then also the mob_entities.csv file which assigns the species to certain entities. This is so you don't have to make a separate species for each entity type. Although you can if you wish! The final file is the mob_traits.csv. This is where we assign all of the different traits to the species types. This is separate from the species file as it is much easier to assign/remove traits from a species this way. The fourth component is that loot table you used in the species file. You will need to create that one too.

Mob Species

Example file

data/NAMESPACE/database/mob_species.csv

Name,Min Age,Max Age,Treat Item,Generic Treats,Species Treats,Days to Birth,Days to Maturity,Product Frequency,Products Loot Table,Product Icon
cow,12,20,husbandry:cow_treat,7,24,9,14,1,husbandry:entities/products/milk,minecraft:milk_bucket
chicken,3,10,husbandry:chicken_treat,5,26,3,3,1,husbandry:entities/products/chicken_egg,minecraft:egg
pig,6,10,husbandry:pig_treat,20,10,4,4,1,husbandry:entities/products/truffle,husbandry:truffle_block
sheep,8,12,husbandry:sheep_treat,2,29,5,4,7,husbandry:entities/products/wool,minecraft:white_wool
horse,25,30,husbandry:horse_treat,10,22,24,12,0,none,minecraft:air
llama,15,25,husbandry:llama_treat,7,24,11,10,0,none,minecraft:air
rabbit,8,12,husbandry:rabbit_treat,14,14,4,3,4,husbandry:entities/products/rabbit_foot,minecraft:rabbit_foot
cat,10,20,husbandry:cat_treat,3,24,5,7,0,none,minecraft:air
dog,10,13,husbandry:dog_treat,24,3,5,7,0,none,minecraft:air
donkey,25,30,husbandry:horse_treat,22,11,24,12,0,none,minecraft:air
parrot,25,50,husbandry:parrot_treat,3,24,4,36,0,none,minecraft:air
mooshroom,13,21,husbandry:cow_treat,24,7,11,21,1,husbandry:entities/products/mushroom_stew,minecraft:mushroom_stew

Fields Explained

Field Info
Name The unique name for this species
Min Age The minimum lifespan in YEARS
Max Age The maximum lifespan in YEARS
Treat Item The item to use as this species 'type' treat

Note: You will need to give any new items the item tag husbandry:treat for this to work

Generic Treats The number of generic treats needed to level up this species
Species Treats The number of species treats needed to level up this species
Days to Birth The number of days until this species gives birth/egg hatches
Husbandry uses real life months OR weeks in real life
Days to Maturity The number days until this species reaches adulthood
Husbandry uses real life months OR weeks in real life
Product Frequency The number of days between being able to produce a product
Products Loot Table The loot table to use when generating this animals product
Product Icon An item to use as this products icon when rendering in the Mob Tracker

Mob Entities

Example file

data/NAMESPACE/database/mob_entities.csv

Entity,Species
minecraft:cow,cow
minecraft:chicken,chicken
minecraft:pig,pig
minecraft:sheep,sheep
minecraft:horse,horse
minecraft:llama,llama
minecraft:rabbit,rabbit
minecraft:cat,cat
minecraft:wolf,dog
minecraft:donkey,donkey
minecraft:mule,donkey
minecraft:parrot,parrot
minecraft:mooshroom,mooshroom

Fields Explained

Field Info
Entity The entity type id
Species The species to assign to this entity

Mob Traits

Example file

data/NAMESPACE/database/mob_traits.csv

Species,Trait
cow,mortal
cow,mammal
cow,pettable
cow,treatable
cow,astraphobic
cow,diurnal
cow,eats_grass
cow,cleanable
cow,bucketable
cow,more_product
chicken,mortal
chicken,eats_bird_feed
chicken,carriable
chicken,treatable
chicken,astraphobic
chicken,aquaphobic
chicken,diurnal
chicken,lays_egg
chicken,more_product

Fields Explained

Field Info
Species The species to assign a trait to
Trait The name of the trait

Traits

Husbandry has a few default traits that can be assigned to each entity. More will be added in the future and suggestions are best posted to the #ideas channel on the discord. https://discord.gg/MRZAyze

Trait Name Info
eats_bird_feed Marks this mob as a consumer of bird feed.
eats_cat_food Marks this mob as a consumer of cat food.
eats_dog_food Marks this mob as consumer of dog food.
eats_grass Marks this mob to consume hay and eat grass blocks.
eats_rabbit_food Marks this mob as consumer of rabbit food.
eats_slop Marks this mob as consumer of slop.
carriable This mob will be able to be carried for happiness.
Conflicts with pettable
cleanable This mob requires cleaning.
pettable This mob can be pet each day for happiness
Conflicts with carriable
treatable This mob accepts treats to increase their happiness levels.
astraphobic This mob will try to find shelter in storms.
aquaphobic This mob will try to find shelter when it is raining.
diurnal This mob will try to find shelter at night.
mammal This mob is able to be impregnanted.
mortal This mob will only live a certain number of years.
pet This mob counts as a pet.
Note this does nothing currently
bowlable This mob produces a product when right clicked with a bowl.
example: mooshroom
drops_product This mob will drop its product as an item.
example: rabbit foot
faster_product_reset This mob will reset its product quicker.
example: sheep growing wool quicker
finds_product This mob will place its product as a block in the world
example: pig truffles
lays_egg This mob will seek out a nest to place its product in.
example: chickens
bucketable This mob will produce a product when right clicked with an empty bucket
example: cow
more_product_chance This mob will have a greater chance to reset their product count every 2 ingame hours as they level up.
more_product This mob will produce more product each day as they level up.
shearable This mob will produce its product when right clicked with shears
example: sheep
nocturnal This mob will seek shelter in the day.
requires_food This mob will die if they are not fed food for several days.
lameable This mob can be lamed to the point it will no longer attack players.
note: experimental, activates when right clicking mob, will be more advanced in future

Loot table examples

Simple example used by the chicken

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:egg"
        }
      ]
    }
  ]
}

More complicated example used by sheep

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": {
        "min": 5.0,
        "max": 11.0,
        "type": "minecraft:uniform"
      },
      "entries": [
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:0b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:white_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:1b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:orange_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:2b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:magenta_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:3b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:light_blue_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:4b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:yellow_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:5b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:lime_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:6b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:pink_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:7b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:gray_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:8b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:light_gray_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:9b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:cyan_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:10b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:purple_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:11b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:blue_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:12b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:brown_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:13b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:green_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:14b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:red_wool"
        },
        {
          "type": "minecraft:item",
          "conditions": [
            {
              "condition": "minecraft:entity_properties",
              "predicate": {
                "nbt": "{Color:15b}"
              },
              "entity": "this"
            }
          ],
          "name": "minecraft:black_wool"
        }
      ]
    }
  ]
}