# SafeClear
Paper plugin for quick cleanup around the player: item frames, dropped items, entities (mobs and others), and villagers with persistent spawn blocking, periodic auto-clean, and undo (up to 5 actions back).
## Contact me
You can DM me here on [Discord](https://discord.com/users/852481562288062504) if you got any issues or suggestions
## Compatibility
- Look in the versions tab
- Java 17+ (bytecode compiled for Java 17, runs fine on newer JVMs too)
## Commands explanation
All commands can only be used by a player (cannot be used from console).
When `` (or more precisely radius) is expected, you can type **`infinite`** if you want to affect the entire server.
**Argument order rule:** on every command it applies to, filters come first, then distance, then (if applicable) percentage last ` [percentage%]`.
### `/safeclear itemframes [empty|map|item|all] [percentage%]`
Removes item frames within a radius of `` blocks around the player.
- `all` / `glow` / `normal`: filters by frame type (normal, glowing or both).
- The content filter (2nd argument) is optional — **defaults to `empty`** if omited:
- `empty`: empty frames
- `map`: frames containing a map
- `item`: frames containing any other item
- `all`: all frames regardless of content
- Optional percentage at the end: individual removal chance per matching frame. Omited = 100%.
Examples:
```/safeclear itemframes all 20``` clears all item frames within a 20 blocks radius
`/safeclear itemframes glow map 30` clears glow item framew within a 30 blocks radius
`/safeclear itemframes normal 15 50%` clears half normal item frames within a 15 blocks radius.
Permission: `safeclear.itemframes` (default: op)
### `/safeclear items [percentage%]`
Removes dropped item entities within a radius of `` blocks.
Permission: `safeclear.items` (default: op)
### `/safeclear entity [percentage%]`
Removes all entities of the given types (mobs, but also any other entity: armor stand, minecart, boat, etc.) within a given radius.
- Types separated by commas: `zombie,skeleton,phantom`.
- Targeting players is blocked for safety of course, imagine getting cleared x)
Examples:
```
/safeclear entity wandering_trader,bat 20
/safeclear entity zombie 30 50%
```
Permission: `safeclear.entity` (default: op)
### `/safeclear blockentity ...`
Prevents an entity type from spawning **server-wide**, with 3 levels:
- `natural`: blocks only "world" spawns (natural spawn, spawner, raid, wild breeding, etc.) a player can still spawn one (egg, command, manual breeding).
- `spawn`: blocks all spawns.
- `existence`: same as `spawn`, and also removes every existing instance present on the server.
The blocked-types list is persistent (saved to `config.yml`).
```
/safeclear blockentity add phantom,zombie spawn
/safeclear blockentity add wither_skeleton natural
/safeclear blockentity remove phantom
/safeclear blockentity list
/safeclear blockentity clear
```
Permission: `safeclear.blockentity` (default: op)
### `/safeclear villagers [percentage%]`
Removes villagers within a given radius, with filters:
- `adult` / `child` (or `baby`)
- `employed` / `unemployed` (no profession or nitwit)
- `nitwit` (villagers who will never be able to get a job)
- `all` (no filter, must be written explicitly if you don't want to filter)
- or directly a profession name: `farmer`, `librarian`, `cleric`, `fisherman`, `fletcher`, `shepherd`, `toolsmith`, `weaponsmith`, `armorer`, `butcher`, `leatherworker`, `mason`, `cartographer`, etc.
Example: `/safeclear villagers unemployed,child 20` removes villagers that are **both** unemployed **and** babies within a 20-block radius.
Permission: `safeclear.villagers` (default: op)
### `/safeclear autoclear `
Periodic, automatic cleanup **across the whole server** (all worlds, no radius or reference player) meant to reduce lag by regularly removing entities that pile up (dropped items, hostile mobs, etc.).
- `entities `: sets which entity types get removed each cycle (replaces the current list). Required before `enable`.
- `interval `: changes the delay between cleanups. Accepts a plain number of seconds or a `s`/`m`/`h` suffix (`30s`, `5m`, `1h`). Default: `600s` (10 minuts).
- `enable`: turns on periodic cleanup (refuses if no entity type is configured).
- `disable`: turns off periodic cleanup.
- `status`: shows the current state (enabled/disabled, interval, targeted types).
The configuration (enabled, interval, types) is persistent (saved to `config.yml`).
```
/safeclear autoclear entities item,zombie,skeleton
/safeclear autoclear interval 15m
/safeclear autoclear enable
/safeclear autoclear status
/safeclear autoclear disable
```
A message is broadcast server-wide after each cycle that removed at least one entity.
Permission: `safeclear.autoclear` (default: op)
### `/safeclear undo`
Undoes the last removal performed by the player (item frames, items, entities, or villagers), restoring their position, type, and main traits (content/rotation for frames, profession/level/age for villagers). Very good feature, well optimized, really proud of it.
- **Up to 5 successive undos** are possible (can be modified up to 15 through the config.yml file)
- The history is **in-memory only**: it is lost if the server stops or restart
- Restored entities are new entities (new UUID)
Permission: `safeclear.undo` (default: op)
Thanks for reading all of that, and I hope you will enjoy using this plugin!
## License
MIT
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.20.1, 1.20.2, 1.20.3
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Hangar — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
SafeClear is a free Minecraft Java mod. Compatible with Minecraft 1.20.1, 1.20.2, 1.20.3, 1.20.4 and newer. Downloaded 4 times (via Hangar). Download it and open it directly in the game.