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:
Restart the server after editing. You can also try a manual clear first with the command below:
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:
| Config | Default | Description |
|---|---|---|
entity.clear.item.enable | false | Whether to auto-clear dropped items |
entity.clear.item.time | 1800 | Drop-clear interval (seconds). 1800s = 30 minutes. |
entity.clear.item.mode | whitelist | Clear mode: whitelist (default) or blacklist |
entity.clear.item.whitelist | [] | Item list; meaning depends on mode (see below) |
entity.clear.monster.enable | false | Whether to auto-clear mobs |
entity.clear.monster.time | 1800 | Mob-clear interval (seconds) |
entity.clear.monster.mode | whitelist | Clear 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.ymlediting — 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:
| Condition | Description |
|---|---|
| Item type in whitelist | Matched by registry key minecraft:diamond or name DIAMOND |
| Item has custom model data | custom_model_data tag is non-zero (mostly mod/resource-pack items) |
| Item has NBT data | Persistent 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:
| Condition | Description |
|---|---|
| Entity type in whitelist | Matched by registry key minecraft:zombie |
| Mob has a custom name | e.g. a mob named with a name tag |
| Mob is a persistent entity | An entity set not to despawn naturally (command-spawned, special tags) |
| Mob has NBT data | Persistent data container (PDC) is non-empty |
Whitelist Match Example
Commands
The entity-clear command is /entityclear, permission node youer.command.entityclear. It must be enabled in youer-config/commands.yml (see below).
| Command | Description |
|---|---|
/entityclear | Immediately clear dropped items and mobs in all worlds |
/entityclear item | Immediately clear dropped items in all worlds |
/entityclear entity | Immediately clear mobs in all worlds |
/entityclear all | Immediately clear dropped items and mobs in all worlds (same as no args) |
/entityclear trash | Open the trash GUI (available to all players, no permission needed) |
/entityclear add item | Open a GUI to place items, or type an item ID/wildcard directly, to add to the drop-protection list |
/entityclear add entity | Open a GUI to place spawn eggs, or type an entity ID/wildcard/blacklist entry directly, to add to the mob-protection list |
/entityclear show item | Open a GUI to view the drop-protection list; right-click to remove |
/entityclear show entity | Open a GUI to view the mob-protection list; right-click to remove |
Enable the command
In youer-config/commands.yml:
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
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):
modid:* is a wildcard meaning all items of that mod.
Add mobs
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):
Entries prefixed with ! are a blacklist, taking priority over whitelist and other protection conditions; blacklisted entities are cleared unconditionally.
View / Remove
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:
| Key | Default 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.