SafeClear
Paper 插件,用于快速清理玩家周围的物品展示框、掉落物、实体(怪物和其他实体)以及村民。支持持久化出生阻止、定期自动清理和撤销操作(最多可撤销 15 步,默认为 5 步)。
联系我
如果你有任何问题或建议,可以通过 Discord 私信我。
兼容性
- 请查看版本标签页
- Java 17+(字节码针对 Java 17 编译,在较新的 JVM 上也能正常运行)
命令说明
所有命令只能由玩家使用(无法从控制台执行)。
当期望输入 <distance>(更准确地说是半径)时,如果你想影响整个服务器,可以输入 infinite。
参数顺序规则: 在所有适用的命令中,过滤器优先,其次是距离,最后是(如果适用)百分比 <filters...> <distance> [percentage%]。
/safeclear itemframes <all|glow|normal> [empty|map|item|all] <distance> [percentage%]
移除玩家周围 <distance> 格半径内的物品展示框。
all / glow / normal:按展示框类型过滤(普通、发光或两者)。
- 内容过滤器(第二个参数)是可选的,如果省略则默认为
empty:
empty:空的展示框
map:包含地图的展示框
item:包含其他任何物品的展示框
all:所有内容的所有展示框
- 末尾可选的百分比:每个匹配展示框的单独移除概率。省略 = 100%。
示例:
/safeclear itemframes all 20 清除 20 格半径内所有的物品展示框
/safeclear itemframes glow map 30 清除 30 格半径内包含地图的发光展示框
/safeclear itemframes normal 15 50% 清除 15 格半径内一半数量的普通物品展示框。
权限:safeclear.itemframes(默认:op)
/safeclear items <distance> [percentage%]
移除玩家周围 <distance> 格半径内的掉落物实体。
权限:safeclear.items(默认:op)
/safeclear entity <type1,type2,...> <distance> [percentage%]
移除给定半径内指定类型的所有实体(怪物,以及其他任何实体:盔甲架、矿车、船等)。
- 类型之间用逗号分隔:
zombie,skeleton,phantom。
- 出于安全考虑,禁止针对玩家,想象一下被清除了 x)
示例:
/safeclear entity wandering_trader,bat 20
/safeclear entity zombie 30 50%
权限:safeclear.entity(默认:op)
/safeclear blockentity <add|remove|list|clear> ...
阻止某种实体类型在全服范围内生成,共有三个层级:
natural:仅阻止“世界”生成(自然生成、刷怪笼、袭击、野生繁殖等),玩家仍然可以通过鸡蛋、命令或手动繁殖来生成一个。
spawn:阻止所有生成。
existence:与 spawn 相同,并且还会移除服务器上存在的每一个现有实例。
blocked-types 列表是持久化的(保存至 config.yml)。
/safeclear blockentity add phantom,zombie spawn
/safeclear blockentity add wither_skeleton natural
/safeclear blockentity remove phantom
/safeclear blockentity list
/safeclear blockentity clear
权限:safeclear.blockentity(默认:op)
/safeclear villagers <filter1,filter2,...|all> <distance> [percentage%]
移除指定半径内的村民,支持以下过滤条件:
adult / child(或 baby)
employed / unemployed(有职业 或 无职业/笨蛋)
nitwit(永远不会获得职业的村民)
all(无过滤,若不想过滤则必须显式写出)
- 或直接使用职业名称:
farmer、librarian、cleric、fisherman、fletcher、shepherd、toolsmith、weaponsmith、armorer、butcher、leatherworker、mason、cartographer 等。
示例:/safeclear villagers unemployed,child 20 会移除半径 20 格内同时满足“无职业”且为“婴儿”的村民。
权限:safeclear.villagers(默认:op)
/safeclear autoclear <enable|disable|interval|entities|status>
跨整个服务器(所有世界,无需指定半径或参照玩家)定期自动清理,旨在通过定期清除堆积的实体(如掉落物、敌对生物等)来降低延迟。
entities <type1,type2,...>:设置每个周期要移除的实体类型(替换当前列表)。在启用前必须配置此项。
interval <value>:更改清理之间的间隔时间。接受纯数字秒数或带 s/m/h 后缀的值(如 30s、5m、1h)。默认值:600s(10 分钟)。
enable:开启定期清理(若未配置实体类型则拒绝执行)。
disable:关闭定期清理。
status:显示当前状态(启用/禁用、间隔时间、目标实体类型)。
配置项(启用状态、间隔时间、实体类型)是持久化的(保存至 config.yml)。
/safeclear autoclear entities item,zombie,skeleton
/safeclear autoclear interval 15m
/safeclear autoclear enable
/safeclear autoclear status
/safeclear autoclear disable
每次清理至少移除了一个实体后,会向全服广播一条消息。
权限:safeclear.autoclear(默认:op)
/safeclear undo
撤销玩家执行的最近一次移除操作(物品展示框、物品、实体或村民),恢复其位置、类型及主要属性(展示框的内容/旋转角度,村民的职业/等级/年龄)。这是一个非常出色的功能,优化良好,对此深感自豪。
- 最多支持连续撤销 5 次(可通过 config.yml 文件修改,上限为 15 次)
- 历史记录仅存在于内存中:如果服务器停止或重启,历史将丢失
- 恢复后的实体会生成新的实体(拥有新的 UUID)
权限:safeclear.undo(默认:op)
感谢阅读所有内容,希望你喜欢使用这个插件!
许可证
MIT
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 15 actions back, default 5).
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
评论 0
登录后参与评分
还没有评论,来抢沙发吧