> For the complete documentation index, see [llms.txt](https://wiki.flrp.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.flrp.dev/free/economobs/tutorials/loot-table-conditionals-and-overrides.md).

# Loot Table Conditionals and Overrides

## Introduction

You can expand on loot tables with conditionals. These allow you to have certain drops in certain areas, or if an entity was killed with a specific item, and more. Weight overrides allow you to dynamically adjust the drop rate.

## Adding Conditionals

Adding conditionals to a loot table is relatively simple. To assign conditionals, you have to do it when you assign tables to entities. This allows you to flexibly control where conditionals are.  \
\
Below where you define the table for that entry, below you put the conditions section. Then you list all the conditions the table should have. For example:&#x20;

```yaml
mobs:  
  ZOMBIE:
    tables:
      '1':
        table: money_table
        conditions:
          - '[permission] example.permission'
```

To clarify, you simply list what type of condition it is and then the context.&#x20;

```
conditions:
  - "[type] context"
```

The list of supported conditionals is:

* Permission - The player needs a permission.
* World - The player needs to be in a specific world.
* With - The player needs to kill the entity with a certain item.
* Biome - The player needs to be in a specific biome.

{% hint style="info" %}
When using the \[with] conditional, if you decide to use a custom item - be sure to include the hook/plugin where it is from. For example:\
\
An Emerald Sword from ItemsAdder would look like:\
\- "\[with] items\_adder:emerald\_sword"
{% endhint %}

## Example Table with Conditionals

```yaml
mobs:  
  PIG:
    tables:
      '1':
        table: money_table
        conditions:
          - '[permission] example.permission'
          - '[world] world'
          - '[with] DIAMOND_SWORD'
          - '[with] items_adder:emerald_sword'
          - '[biome] PLAINS'
```

***

## Weight Overrides

Along with conditionals, you can define a weight override for the loot table. If you have a collection of tables assigned to an entity, you may want to adjust the weight depending on how difficult it is to kill or its rarity.\
\
Let's say money\_table has a defined weight of 100 in loot.yml and you want to change it to 200 for Pigs.

```yaml
mobs:  
  PIG:
    tables:
      '1':
        table: money_table
        weight: 200
      '2':
        table: item_table
      '3':
        table: full_table
```

Just add a weight section and define it's new weight.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wiki.flrp.dev/free/economobs/tutorials/loot-table-conditionals-and-overrides.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
