Changing Mob Drops

With Hungry Animals, cows drop more than 30+ meats by default. It is because HA cows are considered more expensive than vanilla cows. They have more hp, eat a lot, and grow slowly.

There are some methods to change this behavior. First one is Easy Config. Next is Master Config. The last one is changing loot tables.

Easy Config

You can easily make it"tempo": "fast" . This config make animals less expensive, make cows drop 10+ meats, pigs drop 3 meats.

master/master.json
{
  "difficuly": "normal",
  "tempo": "fast",
  "custom": []
}

Master Config

You can also precisely control meat drop using Master Config. It is done by changing loot tables.

Pattern

First of all, you must indicate pattern for loot tables. "loot_tables/minecraft/*.json" will change all vanilla animals' drop.

master/master.json
{
  "difficuly": "normal",
  "tempo": "slow",
  "custom": [
    {
      "domain": "default",
      "pattern": "loot_tables/minecraft/*.json",
      "modifier": modifier
    }
  ]
}

Modifier

Next step is building modifier. modifiers search json objects by matching their shape, and apply operator to found json objects' fields.

modifier like Example A searches json files with the pattern. Then they will find json object {}, then "height" field. Value of "height" field will be changed by operator.

Example A
{
  "domain": "default",
  "pattern": "loot_tables/minecraft/*.json",
  "modifier": {
    "height": operator
  }
}

Let's checkout examples below. Target A will be modified, but Target B won't. Because Target B's "height" is not directly under the base json object, it is wrapped by one more json object, "image".

Target A
{
  "height": 480,
  "width": 640,
  "url": "https://a3626a.gitbook.io/hungryanimals"
}
Target B
{
  "image": {
    "height": 360,
    "width": 360,
    "image": "https://a3626a.gitbook.io/hungryanimals"
  },
  "name": "Hungry Animals"
}

To modify Target B, the modifier of Example A should contain "image".

Example B
{
  "domain": "default",
  "pattern": "loot_tables/minecraft/*.json",
  "modifier": {
    "image": {
      "height": operator
    }
  }
}

modifiers can contain json array. This modifier searches json array [], and applies operator to every elements of the array.

{
  "domain": "default",
  "pattern": "loot_tables/minecraft/*.json",
  "modifier": [
    operator
  ]
}

Finally modifier for loot tables looks like Example C.

Example C
{
  "domain": "default",
  "pattern": "loot_tables/minecraft/*.json",
  "modifier": {
    "pools": [
      {
        "entries": [
          {
            "functions": [
              {
                "weight_per_meat": operator
              }
            ]
          }
        ]
      }
    ]
  }
}

This will change "weight_per_meat" value. "weight_per_meat" determines number of meats dropped by animals. The amount is calculated by formula:

For example, 550 kg cow with weight_per_meat = 10kg drops (550kg-0.5*500kg)/(10kg) = 30 meats.

Operator

operators are one of addition, multiplication, and assignment. Example Addition will add 10 to every searched json elements, Example Multiplication will multiply 4, Example Assignment will set 0.

Example Addition
{
  "operation": "+",
  "value": 10
}
Example Multiplication
{
  "operation": "*",
  "value": 4
}
Example Assignment
{
  "operation": "=",
  "value": 0
}

According to the meat formula above, increasing "weight_per_meat" decreases meat dropped. * 2 will approximately half the amount. Here's the final example, Example D.

Example D
{
  "domain": "default",
  "pattern": "loot_tables/minecraft/*.json",
  "modifier": {
    "pools": [
      {
        "entries": [
          {
            "functions": [
              {
                "weight_per_meat": {
                  "operation": "*",
                  "value": 4
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Last updated