The Best Resource for Minecraft
The Best Resource for Minecraft

Item Obliterator Wiki

How the blacklist file works, what each list does, and how regular expressions and component matching let one entry cover many items.

7 sections · 634 words

Overview#

Item Obliterator exists for one job: making an item genuinely stop existing in a world, rather than merely being hard to get.

That distinction matters because the usual approaches leave gaps. Hiding an item from the creative menu does not stop it dropping from a chest. Deleting its recipe does not stop a villager selling it. Removing it from loot tables does not stop another mod handing it out. Item Obliterator closes those routes at the same time, from one list.

Everything is driven by a single config file. There is no in-game editor and no companion library to install; the file is read when the game starts and again whenever data packs reload.

The config file#

The file is config/item_obliterator.json5 and it is created with commented defaults the first time the mod runs.

Entries are plain item ids, written as JSON strings and separated by commas:

"blacklisted_items": [
    "minecraft:diamond",
    "minecraft:golden_apple"
]

A line beginning with // is treated as a comment and skipped, so you can annotate a long list or park an entry without deleting it.

Regular expressions#

Start an entry with an exclamation mark and the rest is read as a regular expression rather than a literal id.

"!minecraft:.*_sword"

That single line removes every sword in the game. The advantage over listing them is not just brevity: the pattern keeps matching when another mod adds a sword later, so a pack does not silently spring a leak the next time its mod list grows.

The same syntax works in every list described below.

The narrower lists#

Total removal is often too blunt, so there are three lists that take away one behaviour and leave the rest:

  • only_disable_interactions — the item can be held and crafted, but right-clicking with it does nothing. Useful for something whose effect you want gone while the item stays as a trade good or ingredient.
  • only_disable_attacks — the item cannot be swung at anything. The item is otherwise normal.
  • only_disable_recipes — the recipe disappears but the item itself still works, so existing copies stay usable and it can still be found or traded for.

An item can appear in more than one list; the effects stack.

Matching on component data#

Sometimes the id is not specific enough — you want one potion gone, not every potion. blacklisted_component_data matches against an item's component data instead of its id.

"Potion:\"minecraft:regeneration\""

If the text appears anywhere in the item's components, the item is removed. Regular expressions work here too, with the same leading !.

This check is much more expensive than an id lookup, because every component of every stack has to be examined. Use it for the handful of cases that need it rather than as a general tool.

To find the right value, turn on debug_print_components. It logs the components of whatever you are holding once a second, so you can copy the exact text out of the log.

Performance#

use_hashmap_optimizations switches the plain id lists from a linear scan to a hash lookup. For a pack with a long blacklist that is a worthwhile difference, since the lists are consulted whenever inventories tick.

It does not apply to entries written as regular expressions or to component matching, both of which have to be evaluated one at a time.

Notes#

The blacklist is enforced on the world, not on the client, so a server's list applies to everyone connected to it and players do not need matching config files.

Recipes are filtered before the recipe book is built, so a removed recipe never appears there at all. Recipes whose output cannot be determined are deliberately left alone rather than dropped, so an unusual recipe from another mod will not vanish by accident.

The config reloads with data packs, which means /reload picks up edits without restarting the game.