COWMODSКаталог модов

Smart item deleter V2

Smart Item Deleter v2 is a server-side optimization mod designed to automatically clean up dropped item entities when the item count exceeds a defined threshold.

Автор: metl_play1,8 тыс.1обновлён 19 янв. 2026 г.
УправлениеОптимизацияУтилиты

Описание

How it should work, why and the idea are done by Human
Coded and implemented by AI

🧹 Smart Item Deleter v2

A lightweight, intelligent item cleanup system for NeoForge 1.21.1


📘 Overview

Smart Item Deleter v2 is a server-side optimization mod designed to automatically clean up dropped item entities when the item count exceeds a defined threshold.
It tracks items individually to ensure fair, efficient, and safe removal — deleting only excess, old, and unimportant drops without disrupting normal gameplay.

✅ Supports NeoForge 21.1.215, Youer 1.21.1, AsyncYouer-1.21.1
⚙️ Designed for Create-based and heavily modded survival servers
💾 Low overhead, deterministic cleanup cycles


⚙️ Configuration (for server owners)

Configuration file:

config/smart_item_deleter_v2-common.toml
OptionTypeDefaultDescription
entityCountThresholdint200Number of dropped item entities required before cleanup activates.
minItemAgeMslong15000Minimum age (in milliseconds) before an item becomes eligible for deletion. Prevents immediate removal of new drops.
scanIntervalTicksint20How often (in ticks) the system scans the world for items (20 ticks = 1 second).
scanJitterEnabledbooleantrueAdds small random offset (±scanJitterTicks) to interval to reduce server tick spikes when multiple mods act simultaneously.
scanJitterTicksint2Maximum jitter added/subtracted from each cleanup cycle’s timing.
consoleDebugLoggingbooleantrueWhen false, suppresses cleanup summary messages in the server console.
deletePercentageint90Percentage of eligible items to delete each cycle (0–100). Protects the newest items even when threshold is exceeded.
whitelistModebooleanfalseToggles whitelist (true) or blacklist (false) filtering behavior.
filteredItemslist[]Accepts exact item IDs (minecraft:stone), tag references (#forge:ingots), or wildcard globs with */? (e.g., minecraft:*, minecraft:oak*) that define which items are protected (blacklist) or targeted (whitelist).

Example:

entityCountThreshold = 250
minItemAgeMs = 15000
scanIntervalTicks = 20
deletePercentage = 80
whitelistMode = false
filteredItems = ["minecraft:nether_star", "minecraft:diamond"]

Wildcard example

filteredItems = ["minecraft:oak*"]

This configuration means:

  • Cleanup runs roughly every second.
  • Only starts when >250 dropped items exist.
  • Deletes 80% of all items older than 15 seconds (prioritizing the oldest).
  • Diamonds and Nether Stars will never be deleted.

🧠 Technical Details (for developers and maintainers)

Core Behavior

  • Items are tracked in TrackedItemsData, using persistent per-level storage.
  • Each item stores:
    • UUID
    • dimension
    • firstSeenMs (time first detected)
    • lastSeenMs (time last confirmed)
  • Cleanup only occurs when the total item count exceeds the configured threshold.
  • Items are eligible if:
    1. Their age ≥ minItemAgeMs
    2. They pass the current policy filter (blacklist/whitelist mode)
  • When protectNamedItems is enabled, items with custom names are ignored entirely — they do not count toward the threshold and are never deleted.

Deletion Logic

  • All eligible items are sorted oldest first (ascending by firstSeenMs).
  • The number of deletions per cycle is:
    deletions = min(excess_items, eligible_items * (deletePercentage / 100))
    
  • This ensures:
    • The server maintains stable tick times.
    • Recent player drops are preserved.
    • Automated machines that constantly spill items are kept clean.

Jitter (scan desynchronization)

  • The system uses a randomized interval of:
    nextInterval = scanIntervalTicks ± scanJitterTicks
    
    to avoid simultaneous heavy-tick bursts when multiple mods or systems run periodic updates.

Code Structure

PackagePurpose
core/Cleanup logic, ticking, filtering, and execution
persist/Persistent tracking data (SavedData) for per-world storage
config/Configuration spec and loading
command/Optional /cleanup admin command for manual triggering

Commands

CommandDescription
/cleanup runForces a cleanup cycle manually.
/cleanup status(Planned) Displays tracked item count, eligible items, and current thresholds.
/cleanup configChanges values in the config on the fly.

💡 Future Plans

  • Provide in-game feedback via action bar or server console only
  • Expose metrics to /cleanup status or a scoreboard-compatible data point

📜 License

MIT License — freely usable and modifiable.
Please credit Metl_Play if redistributed.
Would be appreciated if I am mentioned in modpacks, but it's not required.


🧩 Credits

  • Developer: Metl_Play
  • Minecraft: 1.21.1 (NeoForge)
  • Mappings: Parchment mappings
  • Libraries: NeoForge API, standard Java collections

“It’s not just a cleaner mod — it’s a smarter janitor.” 🧠🧹

Галерея

Original-ArtworkChatGPT-enhanced-artwork

Последние версии

Все версии →
release

Smart item deleter V2 0.4.9-neoforged

0.4.9-neoforged
19 янв. 2026 г.1,4 тыс.Minecraft: 1.21.1neoforge
Скачать
Что нового
## 0.4.9-neoforged - 2026-01-19 Changes since 0.4.5-neoforged. ### Changed - Filter rules are now precompiled on config bake (tags/exact/wildcards) and reused during matching. - Cleanup log writing moved off the tick thread via a single-threaded background writer. - Tracked item ages are clamped to avoid negative values after restarts; tracked data clears on server start. - Tracked item map accessor returns an unmodifiable view; invalid dimension IDs fall back to overworld. - Mod logo now uses `icon.png` (256x256 RGBA) at the JAR root. - Updated loader version range to `[2,)`. ### Removed - Removed the old `Smart-Item-Deleter-v2-new.png` logo asset.
release

Smart item deleter V2 0.4.5-neoforged

0.4.5-neoforged
18 янв. 2026 г.41Minecraft: 1.21.1neoforge
Скачать
Что нового
## 0.4.5-neoforged - 2026-01-18 Changes since 0.3.1-neoforged. ### Added - Added `logs/sidV2/cleanup.log` and `logs/sidV2/stats.log` with automatic zip rotation on server start. - `/cleanup stats` output now appends to `logs/sidV2/stats.log` every run. - Added `oldestAttemptedAgeMs` to cleanup log entries for each dimension. - Added per-dimension color coding to `/cleanup stats` output (overworld green, nether red, end yellow, others purple). ### Changed - Cleanup summaries are now aggregated across dimensions; console output is a single line when enabled. - Cleanup log output now always writes to `logs/sidV2/cleanup.log` when deletions occur; `consoleDebugLogging` only controls the console summary. - Threshold/excess calculations now ignore filtered or protected items (only deletable candidates count toward the threshold). ### Removed - Removed `/cleanup dryrun`.
release

Smart item deleter V2 0.3.1-neoforged

0.3.1-neoforged
29 нояб. 2025 г.198Minecraft: 1.21.1neoforge
Скачать
Что нового
# Changelog ## 0.3.1-neoforged - 2025-11-29 Changes since 0.2.3 Now Compatible with NeoForge 21.1.215+, Youer-1.21.1, AsyncYouer-1.21.1 ### Added - Added `/cleanup config` commands to list, read, and set config values at runtime with tab completion, validation against the config spec, and saving changes before re-baking settings. - Added automatic discovery of config bindings and tracking of the active server config during load and reload so runtime updates target the correct spec. ### Changed - Bumped NeoForge to 21.1.215 and retargeted the mod version to `0.3.1-neoforged`. - Disabled console cleanup summaries by default (configurable via `consoleDebugLogging`). - Replaced chunk AABB scanning with `level.getAllEntities()` and per-level schedules to keep cleanup in lockstep with async ticking environments.
release

Smart item deleter V2 0.2.3

0.2.3
9 нояб. 2025 г.47Minecraft: 1.21.1neoforge
Скачать
Что нового
- Wildcard filter added. Please keep in mind that filtered Items still counts toward the threshold, as they still contribute to server load. **In Detail:** Added wildcard-aware matching in PolicyEngine.filterPredicate, enabling filterList entries to use * and ? patterns and translating them into regex via new helper methods so namespace-wide and prefix filters (e.g., minecraft:*, minecraft:oak*) are honored. https://github.com/metl-play/smartitemdeleterv2/issues/3
release

Smart item deleter V2 0.2.2

0.2.2
7 нояб. 2025 г.35Minecraft: 1.21.1neoforge
Скачать
Что нового
## ⚙️ Enhancement - **Added a new configuration option to disable console output**: ```properties consoleDebugLogging = false - It is recommended to keep console output enabled initially to verify your setup and disable it once confirmed. Re-enable logging whenever you suspect a bug or need to provide debug information. ## 🐞 Resolved - https://github.com/metl-play/smartitemdeleterv2/issues/5
release

Smart item deleter V2 0.2.1

0.2.1
3 нояб. 2025 г.28Minecraft: 1.21.1neoforge
Скачать
Что нового
## New Features - Implemented `/cleanup now`, `/cleanup now force`, `/cleanup stats`, and `/cleanup dryrun` command handlers. (Not all working as intended for now, i.e. empty stats.) - Includes aggregated feedback for admins. - Supports dry-run previews and per-dimension reporting. ## Refactors & Improvements - Refactored the cleanup engine to: - Expose reusable analysis summaries. - Support forced execution overrides. - Improve logging with detailed configuration context for each run. - Updated `/cleanup` command registration to use the standard permission system, allowing execution by OP players or the server console. ## Code Maintenance - Removed the unused forced-analysis overload and redundant threshold accessor to eliminate dead code. - Ensured tracked item entries correctly mark saved data as dirty when their last-seen timestamp changes, improving persistence accuracy.
beta

Smart item deleter V2 0.1.2

0.1.2
2 нояб. 2025 г.34Minecraft: 1.21.1neoforge
Скачать
Что нового
Fixed: - Jitter configuration is now respected. - Possible NullPointer-Exception resolved, if cleanup filter list was empty. - Potential infinite grow of persistent data, fixed. - Fixed problem where setDirty ran every tick. resolved issue: https://github.com/metl-play/smartitemdeleterv2/issues/2#issue-3572517315
beta

Smart item deleter V2 0.1.1

0.1.1
7 окт. 2025 г.49Minecraft: 1.21.1neoforge
Скачать
Что нового
Initial release for testing if this mod behaves as expected. This release is NOT compatible with AsyncYouer, but normal Youer is fine. Tested with 51 Mods Simultanously. -> Not in depth, not tested if other mods behavior breaks. This mod works with them installed.