> For the complete documentation index, see [llms.txt](https://plugins.elitefantasy.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plugins.elitefantasy.net/mechanics/unearthmechanic/config-examples.md).

# Config Examples

## Furniture

```yaml
unearth:
  furniture:
    fish_destroyed_1:
      no_protect: false #If true, the furniture will not protected by protections plugins
      base: "ia:elitefantasy:fish_destroyed_sand_1" #Item base
      tool: #With which tool do you want to make the change, if you want to use your hand, remove it.
        - ia:elitefantasy:copper_shovel
      transformation:
        stages: #The stages are as to what next model it will change to
          1:
            furniture_id: "ia:elitefantasy:fish_destroyed_sand_2"
            # remove_item_main_hand: true
            # reduce_item_main_hand: 1
            # only_one_drop: true
            # reduce_durability: 100
            # reduce_usages_ia: 1
          2:
            furniture_id: "ia:elitefantasy:fish_destroyed_sand_3"
          3:
            drops: #Which item do you want to drop when you reach the last state
              - "ia:elitefantasy:fish_destroyed_3;1;100"
            #only_one_drop: true
            remove: true #Eliminate the furniture from the floor
```

#### furniture\_random\_id

Only 1 random piece of furniture is selected from the list to be the stage 1

\<furniture\_id;chance> The sum of all the listed probabilities must equal `100`

This supports up to two decimal places in the probability, for example, `0.01`

```yml
            furniture_random_id:
              - "ia:glozz:furniture_1;75"
              - "ia:glozz:furniture_2;5"
              - "ia:glozz:furniture_3;5"
              - "ia:glozz:furniture_4;5"
              - "ia:glozz:furniture_5;5"
              - "ia:glozz:furniture_6;5"
```

## Block

```yaml
unearth:
  block:
    fish_destroyed_1:
      no_protect: false #If true, the block will not protected by protections plugin
      base: "ia:elitefantasy:fish_destroyed_sand_1" #Item base
      tool: #With which tool do you want to make the change, if you want to use your hand, remove it.
        - ia:elitefantasy:copper_shovel
      transformation:
        stages: The stages are as to what next model it will change to
          1:
            block_id: "ia:elitefantasy:fish_destroyed_sand_2"
          2:
            block_id: "ia:elitefantasy:fish_destroyed_sand_3"
          3:
            drops: #Which item do you want to drop when you reach the last state
              - "ia:elitefantasy:fish_destroyed_3;1;100"
            remove: true #Eliminate the block from the floor
```

#### block\_random\_id

Only 1 random piece of furniture is selected from the list to be the stage 1

\<block\_id;chance> The sum of all the listed probabilities must equal `100`

This supports up to two decimal places in the probability, for example, `0.01`

```yml
            block_random_id:
              - "ia:glozz:furniture_1;75"
              - "ia:glozz:furniture_2;5"
              - "ia:glozz:furniture_3;5"
              - "ia:glozz:furniture_4;5"
              - "ia:glozz:furniture_5;5"
              - "ia:glozz:furniture_6;5"
```

{% file src="/files/IiXU6qFRK3VIPWY6t906" %}

## Interaction Mode

### `INTERACT`

{% hint style="success" %}
Unless otherwise specified, this will be the default
{% endhint %}

```yaml
unearth:
  furniture:
    campfire_open:
      mode: INTERACT
      base: "ce:elitefantasy:campfire"
      tool:
        - "mc:air"
      transformation:
        stages:
          1:
            furniture_id: "ce:elitefantasy:campfire_open"
```

### `INTERACT_SHIFT`

```yaml
unearth:
  furniture:
    campfire_menu:
      mode: INTERACT_SHIFT
      base: "ce:elitefantasy:campfire"
      tool:
        - "mc:air"
      transformation:
        stages:
          1:
            execute_commands:
              - command: "menu open campfire {player}"
                as_console: true
```

## Some more examples

### reduce\_item

`reduce_item_inventory` - instead of taking the items from your hand, it takes it from your inventory

`batch_item_inventory` - if set to `true`, it will take items from your inventory in batches rather than taking all of the items in your inventory. e.g. if `reduce_item_inventory` is set to 9, it will take 9 of the items from your inventory each time you click when `batch_item_inventory` is set to **TRUE**

```yaml
          2:
            reduce_item_main_hand: 1
            reduce_item_inventory: 1
            batch_item_inventory: true
```

other example of batch

this is the block

```yaml
    crate_packer_apple:
      base: "nexo:crate_packer"
      tool:
        - "mc:apple"
      transformation:
        stages:
          1:
            furniture_id: "nexo:crate_packer"
            reduce_item_inventory: <NUMBER>
            batch_item_inventory: <TRUE/FALSE>
            drops:
              - "nexo:apple_crate;1;100"
```

two scenarios

scenario 1:

`reduce_item_inventory: 9` \
`batch_item_inventory: false`

When I right click block it will take all 64 apples, divide it by 9 and give me 7 apple crates and 1 apple

scenario 2:

`reduce_item_inventory: 9`\
`batch_item_inventory: true`&#x20;

When I right click block it will take only 9 apples and give me 1 crate. I keep to keep clicking for it to take apples in groups ("batches") of nine to turn into crate

### Drops & Items\_add

`"<item_id>;<quantity>;<probability>"`

This can be used to drop various items

```yaml
          3:
            drops: #Which item do you want to drop when you reach the last state
              - "ia:elitefantasy:fish_destroyed_3;1;35"
              - "mc:stone;1-13;:65"
              - "mc:charcoal;1-6:95"
            #only_one_drop: true
            remove: true #Eliminate the furniture from the floor
```

```yaml
          3:
            items_add: #the item will be added to the inventory instead of dropping it
              - "ia:elitefantasy:fish_destroyed_3;1;35"
              - "mc:stone;1-13;:65"
              - "mc:charcoal;1-6:95"
            #only_one_add: true
```

#### Another Example

In this example, it's a simple swap, clicking switches the model to off or on state, either one or the other :)

```yaml
    big_lantern_on:
      base: "ia:elitefantasy:big_lantern_on" #Item base
      transformation:
        stages: #The stages are as to what next model it will change to
          1:
            furniture_id: "ia:elitefantasy:big_lantern_off"
    big_lantern_off:
      base: "ia:elitefantasy:big_lantern_off" #Item base
      transformation:
        stages: #The stages are as to what next model it will change to
          1:
            furniture_id: "ia:elitefantasy:big_lantern_on"
```

### Permission on Stages

If the player does not have the specified permission, they will not do anything.

```yaml
        stages:
          1:
            block_id: "ia:elitefantasy:fish_destroyed_sand_2"
            permission: "unearth.test1"
          2:
            block_id: "ia:elitefantasy:fish_destroyed_sand_3"
            permission: "unearth.test2"
```

### Multiple Base

This allows you to create configurations with multiple bases, making it easier to create configurations, it is important to specify at the end `“mc:example;example_1”` as it will end up being the id `“mc:example_example_1”` and will fix errors.

```yaml
unearth:
  block:
    white_stripped_log_1:
      base:
        - "mc:stripped_oak_log;1"
        - "mc:stripped_spruce_log;2"
        - "mc:stripped_birch_log;3"
        - "mc:stripped_jungle_log;4"
        - "mc:stripped_acacia_log;5"
        - "mc:stripped_dark_oak_log;6"
        - "mc:stripped_mangrove_log;7"
        - "mc:stripped_cherry_log;8"
        - "mc:stripped_warped_log;9"
        - "or:white_stripped_log;10"
        - "or:orange_stripped_log;11"
        - "or:magenta_stripped_log;12"
        - "or:light_blue_stripped_log;13"
        - "or:lime_stripped_log;14"
        - "or:yellow_stripped_log;15"
        - "or:pink_stripped_log;16"
        - "or:gray_stripped_log;17"
        - "or:light_gray_stripped_log;18"
        - "or:cyan_stripped_log;19"
        - "or:purple_stripped_log;20"
        - "or:blue_stripped_log;21"
        - "or:brown_stripped_log;22"
        - "or:green_stripped_log;23"
        - "or:red_stripped_log;24"
        - "or:black_stripped_log;25"
      tool:
        - "or:white_brush"
      transformation:
        stages:
          1:
            block_id: "or:white_stripped_log"
            reduce_durability: 1
```

### Sounds in Stages

<pre class="language-yaml"><code class="lang-yaml">unearth:
  block:
    white_stripped_log_1:
      transformation:
        stages:
          1:
<strong>            sounds:
</strong>              - sound: "minecraft:block.sand.break"
                volume: 1.0
                pitch: 1.0
                delay: 0
</code></pre>

### Delay on Stages

This is used to add delay when swapping blocks, for example when clicking it will take 1 second to swap, works on tool and stage.

```yaml
        stages:
          1:
            block_id: "or:white_stripped_log"
            delay: 6
            tool_anim_on_delay: true
```

### Execute Commands

If the command isn't run from the console, the player will run it

```yaml
      transformation:
        stages:
          1:
            furniture_id: "ia:glozz:furniture_0"
            execute_commands:
              - command: "clear {player}"
                as_console: true #true/false
```

### Region Conditions

{% hint style="warning" %}
This is for WorldGuard regions
{% endhint %}

| Types Available | Description                                                |
| --------------- | ---------------------------------------------------------- |
| `whitelist`     | Works only within the regions on the list                  |
| `blacklist`     | Foesn't work within the regions on the list                |
| `only_global`   | Works only outside WorldGuard regions (no list argument)   |
| `deny_global`   | It only works inside WorldGuard regions (no list argument) |

This only will works on regions `hospital` & `house`

```yaml
unearth:
  block:
    pattern_bricks_test:
      base: "ce:painter:pattern_bricks"
      transformation:
        stages:
          1:
            region-conditions:
              - type: whitelist
                list:
                  - hospital
                  - house
            block_id: "ce:painter:pattern_bricks[pattern=2]"
```

This only works if you're inside a region, but not inside the `spawn` or `safe_zone`

```yaml
           region-conditions:
              - type: deny_global
              - type: blacklist
                list:
                  - spawn
                  - safe_zone
```

### Food Feature

You can use this to make cake decorations

```yaml
      transformation:
        stages:
          1:
            food_add: 4
            saturation_add: 3.0
```

### CustomCrops special Support

This stage option allows UnearthMechanic to validate and consume water from watering cans registered by CustomCrops.

CustomCrops must be installed and enabled. If the integration is unavailable, stages using `customcrops_watering_can` will be blocked and a warning will be printed to the console.

{% hint style="info" %}
The regular `tool` option still controls which items can activate the transformation. The `cans` option performs an additional check against the watering cans registered by CustomCrops.
{% endhint %}

**Options**

| Option             | Type    | Default    | Description                                                                                                                                    |
| ------------------ | ------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| cans               | List    | \["\*"]    | Accepted CustomCrops watering cans. Use \* to accept every registered watering can. Item IDs and watering-can configuration IDs are supported. |
| water.require      | Integer | 1          | Minimum amount of water required to execute the stage.                                                                                         |
| water.consume      | Integer | 1          | Amount of water removed after the stage succeeds.                                                                                              |
| water.consume\_on  | String  | success    | Determines when water is consumed. Currently, only success is supported.                                                                       |
| charge\_mode       | String  | activation | Controls whether water is consumed once per interaction or once per affected target.                                                           |
| respect\_infinite  | Boolean | true       | Infinite watering cans bypass water validation and consumption.                                                                                |
| creative           | String  | consume    | Controls water validation and consumption for players in Creative mode.                                                                        |
| on\_fail.actionbar | String  |            | My packages use some things that aren't in bettermodel                                                                                         |
| on\_fail.sound     | String  |            | Sound played when validation fails.                                                                                                            |

Negative values in `water.require` and `water.consume` are automatically converted to `0`.

The effective minimum water requirement is the highest value between `water.require` and `water.consume`. This prevents a stage from succeeding when the watering can does not contain enough water to pay its consumption cost.

**Charge modes**

| Value        | Description                                                                                        |
| ------------ | -------------------------------------------------------------------------------------------------- |
| `activation` | Consumes water once for the entire interaction. Recommended for tools that affect multiple blocks. |
| `target`     | Consumes water separately for every affected block or furniture target.                            |

**Creative modes**

| Value     | Description                                                           |
| --------- | --------------------------------------------------------------------- |
| `consume` | Creative players must have enough water and will consume it normally. |
| `bypass`  | Creative players bypass both water validation and consumption.        |

**Failure placeholders**

The following placeholders can be used inside `on_fail.actionbar` and `on_fail.sound`:

| Placeholder  | Description                                                              |
| ------------ | ------------------------------------------------------------------------ |
| `{water}`    | Current water stored in the watering can.                                |
| `{capacity}` | Maximum capacity of the watering can.                                    |
| `{require}`  | Effective minimum amount of water required.                              |
| `{consume}`  | Amount of water that will be consumed.                                   |
| `{can}`      | Detected watering-can item ID, or `unknown` when no valid can was found. |

**Complete example**

```yml
unearth:
  block:
    clean_relic:
      base: "ce:example:dirty_relic"
      # UnearthMechanic still requires the held item to be configured as a tool.
      tool:
        - "ce:example:watering_can"
      transformation:
        stages:
          1:
            block_id: "ce:example:clean_relic"
            customcrops_watering_can:
              # Use "*" to accept any watering can registered by CustomCrops.
              cans:
                - "*"
              water:
                # Minimum amount of water required to perform the transformation.
                require: 1
                # Amount of water consumed after a successful transformation.
                consume: 1
                # Currently supported value: success.
                consume_on: success
              # activation: consume once per interaction.
              # target: consume once for every affected target.
              charge_mode: activation
              # Infinite watering cans bypass validation and consumption.
              respect_infinite: true
              # consume: Creative players consume water normally.
              # bypass: Creative players ignore validation and consumption.
              creative: consume
              on_fail:
                actionbar: "<red>The watering can does not have enough water. <gray>({water}/{require})"
                sound: "minecraft:item.bucket.empty"
```

Water is consumed only after the stage has been applied successfully. UnearthMechanic uses the CustomCrops API to update the watering can, including its stored water, lore, appearance, durability, and configured consumption actions.

**Restricting accepted watering cans**

Replace `*` with specific CustomCrops item or watering-can configuration IDs:

```yaml
customcrops_watering_can:
  cans:
    - "example:basic_watering_can"
    - "example:golden_watering_can"

  water:
    require: 3
    consume: 2
    consume_on: success

  charge_mode: activation
  respect_infinite: true
  creative: bypass

  on_fail:
    actionbar: "<red>You need {require} water. <gray>Available: {water}/{capacity}"
    sound: "minecraft:block.note_block.bass"
```

## Sequence in Stages

{% hint style="info" %}
This only supports some features, the list is [`<furniture/block>_id`](#furniture)*,* [*`<furniture/block>_random_id`*](#furniture_random_id)*,* [*`execute_commands`*](#execute-commands)*, and etc*
{% endhint %}

The sequence system is a way to add animations such as wait times between stages, allowing for greater customization when creating things.

```yaml
  block:
    black_bricks_test:
      base: "ia:painter:black_bricks"
      tool:
        - "mc:air"
      transformation:
        stages:
          1:
            block_id: "ia:painter:blue_bricks"
            sequence: #Each step is executed in sequence, followed by step 1.
              20: #delay step 2
                block_id: "ia:painter:yellow_bricks" # step 2
              40: #delay step 3
                furniture_id: "ia:painter:paint_mixer_2" # step 3
              60: #delay step 4
                block_id: "ia:painter:red_bricks" # step 4
          2:
            block_id: "ia:painter:white_bricks" #does not interfere with the sequence, a click is required to execute this stage
          3:
            block_id: "ia:painter:green_bricks"
```

For example, here, first `20` will be executed, then after another `20` ticks, `40` will be executed, and then after another `60`, like a kind of timeline

For example, in this example here, first `ia:painter:white_bricks` will be executed, then `ia:painter:pink_bricks`, then `ia:painter:lime_bricks`, and `finally ia:painter:yellow_bricks`

```yaml
        stages:
          1:
            block_id: "ia:painter:white_bricks" # step 1
            sequence:
              100:
                block_id: "ia:painter:yellow_bricks" # step 4
              10:
                block_id: "ia:painter:pink_bricks" # step 2
              20:
                block_id: "ia:painter:lime_bricks" # step 3
```

Example of logs

```json
[20:32:11 INFO]: handleStage applied for ia:painter:white_bricks in 67070
[20:32:11 INFO]: handleStage in Location{world=world,x=-429.0,y=92.0,z=401.0} - TICK: 67070
[20:32:11 INFO]: Stage 0 has 3 sequence steps.
[20:32:11 INFO]: handleStage applied for ia:painter:pink_bricks
[20:32:11 INFO]: handleStage in Location{world=world,x=-429.0,y=92.0,z=401.0} - TICK: 67080
[20:32:12 INFO]: handleStage applied for ia:painter:lime_bricks
[20:32:12 INFO]: handleStage in Location{world=world,x=-429.0,y=92.0,z=401.0} - TICK: 67090
[20:32:16 INFO]: handleStage applied for ia:painter:yellow_bricks
[20:32:16 INFO]: handleStage in Location{world=world,x=-429.0,y=92.0,z=401.0} - TICK: 67170
[20:32:16 INFO]: Sequence completed in Location{world=world,x=-429.0,y=92.0,z=401.0}
```

#### [furniture\_random\_id](#furniture_random_id) & [block\_random\_id](#block_random_id) also works here!

```yml
        stages:
          1:
            furniture_id: "ia:glozz:furniture_1"
            sequence:
              100:
                furniture_random_id:
                  - "ia:glozz:furniture_2;20"
                  - "ia:glozz:furniture_3;40"
                  - "ia:glozz:furniture_4;60"
                  - "ia:glozz:furniture_5;70"
                  - "ia:glozz:furniture_6;90"
```

#### [execute\_commands](#execute-commands) works here too!

```yaml
            sequence:
              20:
                furniture_id: "ia:glozz:furniture_2"
                execute_commands:
                  - command: "say {player} sequence 1"
                    as_console: true
              40:
                furniture_id: "ia:glozz:furniture_3"
                execute_commands:
                  - command: "clear {player}"
                    as_console: true
```

#### remove

This will immediately cancel the sequence

```yml
        stages:
          1:
            block_id: "ia:painter:white_bricks" # step 1
            sequence:
              100:
                remove: true
```

#### large example of a lot of features

```yaml
      transformation:
        stages:
          1:
            furniture_id: "ia:glozz:furniture_0_sequence"
            execute_commands:
              - command: "msg {player} 1"
                as_console: true #true/false
            items_add:
              - "ia:glozz:tomate;1;100"
            sounds:
              - sound: "minecraft:block.copper_grate.break"
                volume: 1
                pitch: 0.5
            sequence:
              20:
                furniture_id: "ia:glozz:furniture_1"
                execute_commands:
                  - command: "msg {player} 2"
                    as_console: true
                items_add:
                  - "ia:glozz:lechuga;1;100"
                sounds:
                  - sound: "minecraft:block.copper_grate.break"
                    volume: 1
                    pitch: 0.5
              40:
                furniture_id: "ia:glozz:furniture_2"
                execute_commands:
                  - command: "msg {player} 3"
                    as_console: true
                items_add:
                  - "ia:glozz:zanahoria;1;100"
                sounds:
                  - sound: "minecraft:block.copper_grate.break"
                    volume: 1
                    pitch: 0.5
```

### Timed Interaction

| Option           | Description                                                    |
| ---------------- | -------------------------------------------------------------- |
| `collect_window` | It is the time available for interaction                       |
| `outcomes`       | A list of possible outcomes depending on who you interact with |

```yaml
      transformation:
        stages:
          1:
            furniture_id: "ce:kitchen:pan_cooking"
            sequence:
              60:
                furniture_id: "ce:kitchen:pan_half_cooked"
              120:
                furniture_id: "ce:kitchen:pan_ready"
                timed_interaction:
                  collect_window: 60
                  outcomes:
                    spatula:
                      tool:
                        - "ce:kitchen:spatula"
                      success:
                        furniture_id: "ce:kitchen:empty_pan"
                        items_add:
                          - "mc:cooked_beef;100;1"
                    plate:
                      tool:
                        - "mc:bowl"
                      success:
                        reduce_item_main_hand: 1
                        furniture_id: "ce:kitchen:empty_pan"
                        items_add:
                          - "mc:beef_stew;100;1"
                    fallback:
                      success:
                        furniture_id: "ce:kitchen:pan_burned"
                        sounds:
                          - sound: "minecraft:block.fire.extinguish"
                            volume: 1.0
                            pitch: 0.7
              200:
                furniture_id: "ce:kitchen:pan_burned"
                sounds:
                  - sound: "minecraft:block.fire.extinguish"
                    volume: 1.0
                    pitch: 0.7
```

{% hint style="danger" %}
This no Supports&#x20;

```yaml
                      tool:                 
                        - "mc:bowl;delay=6"
                        - "nexo:white_large_brush;depth=1;size=3;deep=3"
                      success:
                        delay: 6
```

{% endhint %}

## Remember the previous Block/Furniture

On apply changes

```yaml
      tool:
        - "ce:painter:magenta_brush;anim=ce:painter:z_magenta_brush_animation;delayAnim=15;sound=painter:painting_brush;delay=6;replaceOnBreak=ce:painter:painting_brush"
      transformation:
        stages:
          1:
            block_id: "ce:painter:magenta_planks"
            reduce_durability: 1
            remember_previous: true
```

To retrieve the block that existed before it was transformed, you must use `um:previous` id

{% hint style="danger" %}
Don't forget to include a `fallback_block_id` or `fallback_furniture_id`
{% endhint %}

```yaml
      tool:
        - "ce:painter:paint_remover;anim=ce:painter:z_paint_remover_animation;delayAnim=5;sound=painter:spray_can;delay=4"
      transformation:
        stages:
          1:
            block_id: "um:previous"
            fallback_block_id: "mc:oak_planks"
            reduce_durability: 1
```

## Tools Configurations

### Affect more than one 1x1 area

```yaml
      tool:
        - "or:white_brush;depth=1;size=3;deep=3"
      transformation:
        stages:
          1:
            block_id: "or:white_stripped_log"
            reduce_durability: 1
```

depth, deep, size

{% hint style="info" %}
if you add a value and do not add the others, it will automatically set the others to 1

durability will be subtracted depending on the number of blocks being replaced
{% endhint %}

### Item Animations on Tools

The animations for example are when you are interacting, you can use another item to simulate that you are painting it or something like that.

```
anim=<item_id>
```

```yaml
delayAnim=<number> 
#These are the ticks at which the tool will continue with its animation item when you stop painting.
```

```yaml
      tool:
        - "nexo:black_brush;anim=nexo:z_black_brush_animation;delayAnim=15;blockInteractions=true"
```

`blockInteractions` is set to `true` by default; while the animation is running, you won't be able to interact with other blocks or furniture

### Sounds on Tools

```yaml
      tool:
        - "nexo:black_brush;sound=mc:item.brush.brushing.generic"
```

### Delay on Tools

This is used to add delay when swapping blocks, for example when clicking it will take 1 second to swap, works on tool and stage.

```yaml
      tool:
        - "or:white_brush;delay=6"
```

### replaceOnBreak

This will allow that for example, when the item you are using loses all its durability, you can give another item with a broken model or something like that that you can reuse instead of crafting another one.

```yaml
      tool:
        - "nexo:black_large_roller;replaceOnBreak=nexo:large_paint_roller"
```

### Permission Per Tool

If the player does not have the specified permission, they will not do anything.

```yaml
      tool:
        - "ia:painter:blue_brush;permission=unearth.webo1"
        - "ia:painter:blue_roller;permission=unearth.webo2"
        - "ia:painter:blue_spray_can;permission=unearth.webo3"
        - "ia:painter:blue_large_roller;permission=unearth.webo4"
```

### TintFurniture Tool

```yaml
      tool:
        - "nexo:black_brush;tintfurniture=255,255,255"
```

## Unique CraftEngine examples

Change the BlockState of Craftengine Block

<pre class="language-yaml"><code class="lang-yaml"><strong>  block:
</strong>    pattern_bricks_test:
      base: "ce:painter:pattern_bricks[pattern=1]"
      tool:
        - "mc:air"
      transformation:
        stages:
          1:
            block_id: "ce:painter:pattern_bricks[pattern=2]"
</code></pre>

Change the Variant of Craftengine Furniture

```yaml
  furniture:
    oak_chair_test:
      base: "ce:painter:oak_chair[variant=ground]"
      tool:
        - "mc:air"
      transformation:
        stages:
          1:
            furniture_id: "ce:painter:oak_chair[variant=wall]"
```
