Entity Clear

「Ban without bounds, manage with order」

Youer's entity-clear feature periodically and automatically clears dropped items and mobs from the world, reducing entity counts and server lag. Admins can also trigger a clear manually.


Quick Start

Find the entity-clear settings in youer-config/youer.yml and set them like this to enable automatic clearing:

yaml

Restart the server after editing. You can also try a manual clear first with the command below:

bash

A 30-second countdown shows at the bottom of every player's screen before clearing starts; stats are shown once clearing finishes.


Auto-Clear Config

All settings live in youer.yml, in two groups (dropped items / mobs), each with four options:

ConfigDefaultDescription
entity.clear.item.enablefalseWhether to auto-clear dropped items
entity.clear.item.time1800Drop-clear interval (seconds). 1800s = 30 minutes.
entity.clear.item.modewhitelistClear mode: whitelist (default) or blacklist
entity.clear.item.whitelist[]Item list; meaning depends on mode (see below)
entity.clear.monster.enablefalseWhether to auto-clear mobs
entity.clear.monster.time1800Mob-clear interval (seconds)
entity.clear.monster.modewhitelistClear mode: whitelist (default) or blacklist
entity.clear.monster.whitelist[]Mob list; meaning depends on mode (see below)

White lists usually don't require manual youer.yml editing — use in-game commands to add/remove. See Add and View Whitelist.


Protection Mechanism (List and Mode)

Dropped items and mobs each keep their own list, whose meaning is decided by the mode config. There are two modes:

  • Whitelist mode (whitelist, default): the list is a protection list — types in the list are not cleared; an empty list clears everything; entries prefixed with ! are force-cleared instead.
  • Blacklist mode (blacklist): the list is a clear list — only listed types are cleared, everything else is protected; entries prefixed with ! are protected instead.

Dropped items and mobs can use different modes: entity.clear.item.mode / entity.clear.monster.mode.

Drop Protection Rules

A dropped item is not cleared if any of the following holds:

ConditionDescription
Item type in whitelistMatched by registry key minecraft:diamond or name DIAMOND
Item has custom model datacustom_model_data tag is non-zero (mostly mod/resource-pack items)
Item has NBT dataPersistent data container (PDC) is non-empty, e.g. enchanted books, written books

Mob Protection Rules

A mob is not cleared if any of the following holds:

ConditionDescription
Entity type in whitelistMatched by registry key minecraft:zombie
Mob has a custom namee.g. a mob named with a name tag
Mob is a persistent entityAn entity set not to despawn naturally (command-spawned, special tags)
Mob has NBT dataPersistent data container (PDC) is non-empty

Whitelist Match Example

yaml

Commands

The entity-clear command is /entityclear, permission node youer.command.entityclear. It must be enabled in youer-config/commands.yml (see below).

CommandDescription
/entityclearImmediately clear dropped items and mobs in all worlds
/entityclear itemImmediately clear dropped items in all worlds
/entityclear entityImmediately clear mobs in all worlds
/entityclear allImmediately clear dropped items and mobs in all worlds (same as no args)
/entityclear trashOpen the trash GUI (available to all players, no permission needed)
/entityclear add itemOpen a GUI to place items, or type an item ID/wildcard directly, to add to the drop-protection list
/entityclear add entityOpen a GUI to place spawn eggs, or type an entity ID/wildcard/blacklist entry directly, to add to the mob-protection list
/entityclear show itemOpen a GUI to view the drop-protection list; right-click to remove
/entityclear show entityOpen a GUI to view the mob-protection list; right-click to remove

Enable the command

In youer-config/commands.yml:

yaml

A restart is required for this to take effect. The manual clear command does not depend on the auto-clear toggle and is always available.


Add and View Whitelist

Add dropped items

bash

Open a 54-slot inventory GUI; place the items to protect (e.g. diamonds) into slots and close the GUI to save. Multiple items at once are supported. Added item types are written to entity.clear.item.whitelist in youer.yml and take effect immediately.

You can also type the item ID directly (Tab autocompletes):

bash

modid:* is a wildcard meaning all items of that mod.

Add mobs

bash

Same as above, but you must place spawn eggs (e.g. zombie spawn egg, ender dragon spawn egg). After closing the GUI, that mob type is written to entity.clear.monster.whitelist.

You can also type the entity ID, wildcard, or blacklist entry directly (Tab autocompletes):

bash

Entries prefixed with ! are a blacklist, taking priority over whitelist and other protection conditions; blacklisted entities are cleared unconditionally.

View / Remove

bash

Open the GUI to view the current protection list. Right-click an entry to remove it from the protection list.


Notification Messages

Clear-related messages are configured via language files (youer-config/lang/, auto-switched with the server language). Commonly used keys:

KeyDefault text (zh_CN)Description
entityclear.item.warn掉落物将在 §c%s §f秒后被清理Drop-clear countdown (refreshes every second, turns red in the last 5 seconds)
entityclear.monster.warn怪物将在 §c%s §f秒后被清理Mob-clear countdown
entityclear.item.done清理物品 §c%s §2组(§c%s§2个),用时 §c%s §2毫秒Drop-clear stats (groups, items, elapsed time)
entityclear.monster.done清理实体 §c%s §2个,用时 §c%s §2毫秒Mob-clear stats

All messages show at the bottom of the player's screen (ActionBar) and do not occupy the chat.


FAQ

After enabling auto-clear, can the manual command still be used?

Yes. The /entityclear manual command is independent of the auto-clear toggle and can be run anytime.

What clear interval is appropriate?

Dropped items: 600~1800 seconds (10~30 minutes) is recommended; adjust mobs by spawn volume. Note the interval must exceed 30 seconds (the countdown duration), otherwise countdowns overlap.

Will whitelisted mobs be cleared?

No. The whitelist is a protection list; added drops/mobs are never cleared automatically or manually.

Will named mobs be cleared?

No. Any mob with a custom name is automatically protected (no whitelist needed).

How do I protect drops I don't want cleared?

Two ways: add to the whitelist via /entityclear add item; or give the item NBT data (e.g. enchanted items, written books), and the system skips it automatically.

Will players disconnect during clearing?

No. Clearing runs on the main thread and usually takes only a few milliseconds, almost imperceptible to players.

© 2019-2026 MohistMCUnofficial Minecraft product. Not approved by or associated with Mojang or Microsoft.