> For the complete documentation index, see [llms.txt](https://lethium.gitbook.io/origin-smp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lethium.gitbook.io/origin-smp/stackmaster/how-to.md).

# How-to

Short recipes for the most common StackMaster changes, and what to check when something does not stack.

Every change below is made in `plugins/StackMaster/config.yml`. Run `/sm reload` afterwards.

## Mobs

{% tabs %}
{% tab title="Let natural mobs stack" %}

```yaml
stacking-entities:
  natural-spawns:
    stack: true
```

Only mobs that spawn after the change stack. Mobs that already spawned keep their `stackmaster:no_stack` mark and stay single. See [Natural spawns](/origin-smp/stackmaster/entity-stacking.md#natural-spawns).

Only for one world:

```yaml
worlds:
  world:
    stacking-entities:
      natural-spawns:
        stack: true
```

{% endtab %}

{% tab title="Stop one mob type stacking" %}
Add it to the blacklist:

```yaml
stacking-entities:
  blacklist:
    - PLAYER
    - ARMOR_STAND
    - ITEM_FRAME
    - GLOW_ITEM_FRAME
    - VILLAGER
    - WANDERING_TRADER
    - ENDER_DRAGON
    - WITHER
    - ELDER_GUARDIAN
    - SHEEP
```

Keep the default entries when you add your own.

Or switch the type off on its own:

```yaml
stacking-entities:
  entities:
    SHEEP:
      enabled: false
```

{% endtab %}

{% tab title="Change the stack size" %}
For all mobs: `stacking-entities.max-stack-size`. For one type:

```yaml
stacking-entities:
  entities:
    ZOMBIE:
      max-stack-size: 500
```

No stack goes above `general.global-max-stack-size` (`10000`). Raise that too if you need more.
{% endtab %}

{% tab title="Kill stacks faster" %}

```yaml
stacking-entities:
  behavior:
    damage:
      max-kills-per-hit: 3
      kill-scaling:
        enabled: true
        enchantment: SWEEPING_EDGE
        kills-per-level: 2
        max-kills: 16
```

Each lethal hit now removes 3 mobs, plus 2 per level of Sweeping Edge, at most 16. See [Killing a stack](/origin-smp/stackmaster/entity-stacking.md#killing-a-stack).
{% endtab %}

{% tab title="Keep baby zombies small" %}
Add the key under `stacking-entities`:

```yaml
stacking-entities:
  grow-baby-zombies: false
```

Baby zombies then only stack with other babies.
{% endtab %}
{% endtabs %}

## Worlds

{% tabs %}
{% tab title="Turn everything off in one world" %}

```yaml
general:
  disabled-worlds:
    - minigames
```

No mobs, items or spawners stack there. Use the world's folder name.
{% endtab %}

{% tab title="Turn one system off in one world" %}

```yaml
worlds:
  world_the_end:
    stacking-items:
      enabled: false
```

{% endtab %}
{% endtabs %}

## Spawners

{% tabs %}
{% tab title="Give or sell spawners" %}

```
/sm give <player> <mob> spawner [amount]
```

Works from the console, so a shop or crate plugin can run it. Example: `/sm give {player} zombie spawner 5` gives one item worth 5 zombie spawners. See [Commands](/origin-smp/stackmaster/commands-permissions.md).

Add the `give-*` messages to `config.yml` first, see [Messages to add](/origin-smp/stackmaster/config-yml.md#messages-to-add).
{% endtab %}

{% tab title="Require Silk Touch" %}

```yaml
stacking-spawners:
  dropping:
    require-silk-touch: true
```

Without Silk Touch the break is cancelled and the player sees `spawner-silk-touch`. Give `stackmaster.spawner.silktouch.bypass` to ranks that may skip it.
{% endtab %}

{% tab title="Change upgrade prices" %}

```yaml
stacking-spawners:
  upgrades:
    speed:
      cost-per-level: 5000
```

Level N costs `cost-per-level × N`. `0` makes the upgrade free. Turn one upgrade off with `enabled: false`, all of them with `upgrades.enabled: false`.
{% endtab %}

{% tab title="Let players change delays" %}

```
/lp group default permission set stackmaster.spawner.delay.edit true
```

Players can then set delays from `gui.delay-editor.lowest` to `highest` (200 to 2400 ticks). Add the `delay-locked` message too, see [Messages to add](/origin-smp/stackmaster/config-yml.md#messages-to-add).
{% endtab %}

{% tab title="Protect spawners from explosions" %}

```yaml
stacking-spawners:
  explosions:
    mode: protect
```

Or keep `one` and let destroyed spawners drop sometimes with `drop-chance: 0.5`.
{% endtab %}

{% tab title="Spawn only in the dark" %}

```yaml
stacking-spawners:
  spawning:
    spawn-no-matter-the-spawn-conditions: false
```

Spawners then follow vanilla light and space rules. Players can still set **Always Spawn** on their own spawner in the menu.
{% endtab %}
{% endtabs %}

## Items

{% tabs %}
{% tab title="Show the count above piles" %}

```yaml
stacking-items:
  entity:
    display-stack-size: true
    display-format: "&b×{size}"
```

{% endtab %}

{% tab title="Merge items with different durability" %}

```yaml
stacking-items:
  compatibility:
    compare-data-components: false
    same-durability: false
```

`compare-data-components` must be `false`, otherwise every detail still has to match.
{% endtab %}
{% endtabs %}

## Something does not stack

{% stepper %}
{% step %}

### Check the basics

* Is the world in `general.disabled-worlds`, or switched off under `worlds.<world>`?
* Is the type in the `blacklist`, or `entities.<TYPE>.enabled: false`?
* Did the mob spawn on its own? With `natural-spawns.stack: false` it never stacks.
* Is the stack already at `max-stack-size`?
  {% endstep %}

{% step %}

### Look for the reason

Set `debug.log-compatibility-failures: true` and `/sm reload`. The console now prints why two mobs or items did not merge, for example `Merge refused (ZOMBIE vs ZOMBIE): age` or `named_identity`. Change the matching rule, or accept it. Turn the log off again afterwards.
{% endstep %}

{% step %}

### Common reasons

| Reason in the log    | Cause                             | Fix                                                                 |
| -------------------- | --------------------------------- | ------------------------------------------------------------------- |
| `age`                | Baby and adult                    | `require-same-age: false`, or `grow-baby-zombies: true` for zombies |
| `named_identity`     | One mob has a name, the other not | By design. Named mobs only stack with the same name.                |
| `variant`            | Different colour or type          | `require-same-variant: false`                                       |
| `effects`            | Different potion effects          | `require-same-effects: false`                                       |
| `damaged`, `burning` | Just hurt, or on fire             | Wait, or `allow-damaged-mobs` / `allow-burning-mobs: true`          |
| `data_components`    | Item data differs                 | See "Merge items with different durability" above                   |
| {% endstep %}        |                                   |                                                                     |

{% step %}

### Force a pass

Stand near the mobs and run `/sm stack`. `/sm stats` shows the totals.
{% endstep %}
{% endstepper %}
