# 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

{% content-ref url="../basics/master-config" %}
[master-config](https://a3626a.gitbook.io/hungryanimals/basics/master-config)
{% endcontent-ref %}

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

{% code title="master/master.json" %}

```
{
  "difficuly": "normal",
  "tempo": "fast",
  "custom": []
}
```

{% endcode %}

## 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.

{% code title="master/master.json" %}

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

{% endcode %}

### Modifier

Next step is building `modifier`. `modifier`s 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.

{% code title="Example A" %}

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

{% endcode %}

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"`.

{% code title="Target A" %}

```
{
  "height": 480,
  "width": 640,
  "url": "https://a3626a.gitbook.io/hungryanimals"
}
```

{% endcode %}

{% code title="Target B" %}

```
{
  "image": {
    "height": 360,
    "width": 360,
    "image": "https://a3626a.gitbook.io/hungryanimals"
  },
  "name": "Hungry Animals"
}
```

{% endcode %}

To modify *Target B*, the `modifier` of *Example A* should contain `"image"`.&#x20;

{% code title="Example B" %}

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

{% endcode %}

`modifier`s 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*.

{% code title="Example C" %}

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

{% endcode %}

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

$$meat = (weight-0.5\*standard\_weight)/weight\_per\_meat$$

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

### Operator

`operator`s 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.

{% code title="Example Addition" %}

```
{
  "operation": "+",
  "value": 10
}
```

{% endcode %}

{% code title="Example Multiplication" %}

```
{
  "operation": "*",
  "value": 4
}
```

{% endcode %}

{% code title="Example Assignment" %}

```
{
  "operation": "=",
  "value": 0
}
```

{% endcode %}

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*.

{% code title="Example D" %}

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

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://a3626a.gitbook.io/hungryanimals/tutorials/changing-mob-drops.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
