Skip to content

Item Selectors Documentation

Grend edited this page Jan 15, 2025 · 7 revisions

Item Selectors Documentation

Iceberg gives mods the ability to easily "select" items based on a given string. These so-called selectors are invaluable for configuration files where options apply to one or more items.

Selectors generally consist of a symbol followed by some text. Please see the definitions below to see all supported options.

All Iceberg versions

  • Item ID
    • You can just use the item's underlying ID to match a specific item. Including the mod ID is required for non-vanilla items.
    • Examples: "minecraft:stick", "iron_ore"
  • Item tag
    • $ followed by an item tag name. Will match all items with the given item tag. Mod ID is optional for vanilla tags. See this page for a list of all built-in item tags. (Ones starting with "forge:" are only available on Forge).
    • Examples: "$forge:stone", "$planks"
  • Mod name
    • @ followed by a mod identifier. Will match all items from the given mod.
    • Examples: "@spoiledeggs"
  • Rarity
    • ! followed by an item rarity. Matches all items with the given vanilla rarity. See this minecraft wiki page for info about rarities.
    • Examples: "!common", "!uncommon", "!rare", "!epic"
  • Item name color
    • # followed by a color hex code, the hex code must match exactly. This will match all items with a tooltip name color that matches the given color code.
    • Examples: "#23F632"
  • Display name
    • % followed by any text. Will match any item with this text in its tooltip name. Note, this is CASE SENSITIVE and any text you enter will be matched against, including spaces.
    • Examples: "%Netherite", "%Spruce"
  • Tooltip text
    • ^ followed by any text. Will match any item with this text anywhere in the tooltip text (besides the name). Like above, this is CASE SENSITIVE and all text will be matched against.
    • Examples: "^Legendary", "^Damage"
  • NBT tag
    • & followed by NBT tag name, and optionally a comparator (=, >, <, or !=) followed by a value, in the format "&<tag><comparator><value>" or just "&<tag>". Matches any item with an NBT tag with a name that matches the given tag and, if applicable, has a value that matches the given comparison.
    • Examples: "&Damage=0", "&Tier>1", "&map!=128", "&Enchantments"

Iceberg versions 1.1.0+

  • Wildcard
    • Using an asterisk by itself (*) will simply match every item.
    • Examples: "*"
  • Negation
    • ~ followed by any selector above. This selector will be negated, matching every item that does NOT match the selector.
    • Examples: "~@minecraft", "~!uncommon"
  • Combining selectors
    • Any number of selectors can be combined by separating them with a plus sign. This will cause all selectors to be evaluated with an AND operation.
    • Examples: "minecraft:diamond_sword+&Enchantments" (matches any enchanted diamond sword), "shears+~!common+&Damage=0" (matches shears with a rarity that's not common and is undamaged)

Clone this wiki locally