Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Avatar for Palmine38

Precise & safe entity cleanup with advanced filters, undo and auto-clear.

Report SafeClear?

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 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 <distance> (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 <filters...> <distance> [percentage%].

/safeclear itemframes <all|glow|normal> [empty|map|item|all] <distance> [percentage%]

Removes item frames within a radius of <distance> 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 <distance> [percentage%]

Removes dropped item entities within a radius of <distance> blocks.

Permission: safeclear.items (default: op)

/safeclear entity <type1,type2,...> <distance> [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 <add|remove|list|clear> ...

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 <filter1,filter2,...|all> <distance> [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 <enable|disable|interval|entities|status>

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 <type1,type2,...>: sets which entity types get removed each cycle (replaces the current list). Required before enable.
  • interval <value>: 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

Information

Category
Admin Tools
Published
September 26, 2026
License
MIT
0Downloads
0Stars

Pinned Versions

  • R
    Paper1.20.1–26.3

Members

1