> For the complete documentation index, see [llms.txt](https://pm2plugins.gitbook.io/infinitecrops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pm2plugins.gitbook.io/infinitecrops/features/random-drops.md).

# Random Drops

<div data-full-width="true"><figure><img src="/files/8Mk4HOl7w0WlK95BbfkP" alt=""><figcaption></figcaption></figure></div>

The **Random Drops** system allows users to define item drops from specific blocks with customizable chances, adding variety and excitement to gameplay. This guide explains how to configure the `random_drops.yml` file to suit your needs.

***

**File Structure**

The `random_drops.yml` file is divided into three main sections:

1. **Global Settings**:
   * Controls whether random drops are enabled and their overall probability.
2. **Chances**:
   * Defines specific items, the blocks they drop from, and the likelihood of their drops.

***

**Configuration Example**

Here’s an example configuration:

```yaml
chanced_drop: true
chance_to_drop: 10
chances:
  apple:
    blocks:
    - BIRCH_LEAVES
    - OAK_LEAVES
    - DARK_OAK_LEAVES
    chance: 60
  cabbage:
    blocks:
    - SHORT_GRASS
    - FERN
    - TALL_GRASS
    chance: 50
  tomato:
    blocks:
    - SHORT_GRASS
    - TALL_GRASS
    chance: 80
```

***

#### **1. Global Settings**

**`chanced_drop`**

* **Type**: Boolean (`true` or `false`)
* **Description**: Enables or disables the random drops system.
* **Example**:

  ```yaml
  chanced_drop: true
  ```

**`chance_to_drop`**

* **Type**: Integer (1–100)
* **Description**: Sets the overall chance (in percentage) of any random drop occurring when breaking a block.
* **Example**:

  ```yaml
  chance_to_drop: 10
  ```

  * In this example, there’s a 10% chance that a random drop will occur when breaking a block.

***

#### **2. Chances**

Each entry under the `chances` section represents an item and includes the following properties:

**`blocks`**

* **Type**: List
* **Description**: Specifies the blocks that can drop the item.
* **Example**:

  ```yaml
  blocks:
  - BIRCH_LEAVES
  - OAK_LEAVES
  - DARK_OAK_LEAVES
  ```

**`chance`**

* **Type**: Integer (1–100)
* **Description**: Sets the likelihood (in percentage) of the item dropping when a defined block is broken.
* **Example**:

  ```yaml
  chance: 60
  ```

  * In this example, there is a 60% chance of the item dropping if the block is broken.

***

#### **Adding or Modifying Drops**

**Step 1: Define a New Item**

Add a new entry under `chances` for the item you want to include. For example, to add a "pineapple" drop:

```yaml
pineapple:
  blocks:
  - SHORT_GRASS
  - FERN
  - TALL_GRASS
  chance: 65
```

**Step 2: Associate Blocks**

List all the blocks from which the item can drop under the `blocks` key.

**Step 3: Set Drop Chance**

Set the probability of the item dropping using the `chance` key.
