跳到正文

Item Clear

A simple datapack for keeping your world clean and running smoothly

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Item Clear

A lightweight vanilla datapack that automatically clears dropped items every 10 minutes, keeping your world clean and reducing entity lag from item buildup.

Features

  • Automatically clears all dropped items every 10 minutes
  • Warning at 10 minutes
  • Warning at 1 minute
  • Final warning at 10 seconds
  • Announces when cleanup is complete
  • Players can hide the cleanup messages for themselves with a single command
  • Customizable message colors for the warnings and the cleanup message
  • Optional on-screen warning 10 seconds before clearing (off by default)
  • Cleanup message shows how many items were removed
  • Countdown command so players can check when the next cleanup happens, with an optional live boss bar countdown
  • Customizable message text with ready-made language presets (English, Italian, Spanish, French, German, Portuguese)
  • Optional dimension exclusion to keep items in chosen dimensions
  • Can be paused and resumed without removing the datapack
  • Vanilla only, no mods and no KubeJS
  • No configuration required to use out of the box

How It Works

Runs on a repeating cycle: 10 minutes → 1 minute → 10 seconds → cleanup → repeat

Only dropped item entities are removed. Players, mobs, blocks, and other entities are unaffected.

Hiding the Messages

Not a fan of the chat messages? Any player can toggle them on or off for themselves, no operator permissions needed:

/trigger item_clear_mute

Run it once to hide the warnings and the cleanup announcement, and run it again to bring them back. Your choice is saved and persists across relogs and server restarts. Items are still cleared for everyone, only the messages are hidden.

Changing the Message Colors

Server operators can change the color of the warnings and of the cleanup message:

/function item_clear:set_color {type:"warn",color:"gold"}
/function item_clear:set_color {type:"done",color:"aqua"}

warn covers the 10 minute, 1 minute and 10 second warnings, done covers the “items cleared” message, and screen covers the on-screen warning.

Available colors: black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, white. Hex colors such as "#ff8800" also work.

To go back to the default colors (red warnings, green cleanup message):

/function item_clear:defaults

Colors apply to everyone on the world, are saved with it, and persist across restarts. A new world starts with the defaults. A color that isn’t on the list will stop that message from showing, so double check the spelling.

On-Screen Warning

Want a bigger heads-up? Server operators can enable a title message that appears in the middle of the screen 10 seconds before the cleanup. It’s off by default.

/function item_clear:screen_on
/function item_clear:screen_off

Its color can be changed like the others, using the screen type:

/function item_clear:set_color {type:"screen",color:"gold"}

Players who hide the messages with /trigger item_clear_mute won’t see it either. The setting is saved with the world.

Checking the Countdown

Any player can see when the next cleanup happens, no operator permissions needed:

/trigger item_clear_time

It shows the time left in minutes and seconds, for example “Next item cleanup in 9m 34s”.

Prefer a countdown that keeps ticking? Turn on the live version, which shows as a boss bar at the top of your screen and updates every second:

/trigger item_clear_timer

Run it again to turn it off. It’s off by default, and your choice is saved.

Changing the Message Text

Server operators can change the wording of any message:

/function item_clear:set_text {key:"warn_1m",text:"Heads up! Items vanish in 1 minute."}

Available keys: warn_10m, warn_1m, warn_10s, clear_pre, clear_post, clear_one, clear_none, screen, next, paused, mute_on, mute_off, timer_on, timer_off.

The cleanup message is built as clear_pre, then the number of items, then clear_post. clear_one is used when exactly one item is removed and clear_none when there is no count to show. Avoid double quotes and backslashes in the text, since they stop that message from showing.

Languages and Presets

Switch every message to another language in one command:

/function item_clear:lang_en
/function item_clear:lang_it
/function item_clear:lang_es
/function item_clear:lang_fr
/function item_clear:lang_de
/function item_clear:lang_pt

This replaces any custom text you set. Color presets are available too:

/function item_clear:preset_default
/function item_clear:preset_soft
/function item_clear:preset_loud
/function item_clear:preset_minimal

Excluding Dimensions

By default items are cleared in every dimension. Server operators can keep items in specific dimensions:

/function item_clear:dimension_exclude {dimension:"minecraft:the_end"}
/function item_clear:dimension_include {dimension:"minecraft:the_end"}
/function item_clear:dimension_list

Use the full dimension id. Modded dimensions work too.

Manual Cleanup

Trigger an immediate cleanup at any time:

/function item_clear:clear

This clears the items right away and restarts the countdown, so the next cycle begins about 10 seconds later. It does nothing while the pack is paused.

Pausing

Turn the cleanup cycle on or off without deleting the datapack:

/scoreboard players set #enabled item_clear 0   # pause
/scoreboard players set #enabled item_clear 1   # resume

Timers keep running in the background while paused, so nothing desyncs when you resume. No warnings or clearing happen while paused.

Editing the Interval

Want a different timing? Open the .mcfunction files inside data/item_clear/function/ (1.21+) or data/item_clear/functions/ (pre-1.21) in a text editor.

The cycle is a chain of schedule function calls, each counting down to the next step. To change the total time before clearing, edit the delay in warn_10m.mcfunction (the first step after the warning message).

Example, changing the cycle from 10 minutes to 15 minutes:

schedule function item_clear:warn_1m 840s

(840s = 14 minutes, since the remaining 1m + 10s warnings after it make up the last minute before clearing)

To keep the countdown command accurate, also change scoreboard players set #cycle item_clear 12000 in load.mcfunction. The number is the delay plus 60 seconds, in ticks (20 ticks per second), so for 840s it would be 18000.

You’ll also want to update the wording (e.g. “10 minutes” → “15 minutes”) with /function item_clear:set_text, so what players see matches the actual timing.

No special tools needed, just a text editor and a repack into a zip.

Compatibility

Lightweight, dependency-free, and works in both vanilla worlds and modpacks.

Perfect For

  • Multiplayer servers
  • Large modpacks
  • Survival worlds
  • Long-running worlds
  • Servers with heavy dropped-item buildup

Keep your world clean without installing a dedicated mod just for item cleanup.

评论

登录后评论和评分

KurotsukiOnArch 的其他作品

查看全部 →