Tag Exclusion

Quick rating

Tag Exclusion

No reviews yet

Library & utility for removing entries from tags

API/Library
Mod Loaders
Fabric
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Where It Runs
Server Only

Runs entirely on the server. Also works in singleplayer.

About

Project Details

Type
Mod
License
MIT License
Latest Version
1.1.1+mc26.1

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

About

Description

This library is now obsolete on 26.1+, as Fabric API and Neoforge now both contain ways to remove entries from tag files.


A library & utility to allow removing entries from tags, to avoid having to use "replace": true in datapacks.

Syntax

There is now an abbreviated syntax for tag entries. You can add a ? at the end of an entry to mark it as optional and a ! at the beginning of an entry to mark it as an exclusion entry.

Exclusion entries will be removed from the tag, including from previous entries in the same tag file and from entries in lower packs.

Example:

{
  "values": [
    
    "#minecraft:doors",
    // Add all doors
    "!minecraft:spruce_door",
    // Except the spruce door
    
    "#minecraft:logs",
    // Add all logs
    "!#minecraft:logs_that_burn",
    // But not the ones that burn
    
    "create:brass_casing?",
    // Add create brass casing, if it's installed
    
    "!#enderscape:veiled_logs?"
    // Remove enderscape veiled logs, if it's installed
    
  ]
}

The standard expanded format is also extended.

{
  "values": [
    "#minecraft:logs",
    {
      "id": "#minecraft:logs_that_burn",
      "tagex:exclude": true
    }
  ]
}

Depending on Tag Exclusion

Currently, it is recommended to use JitPack to add the mod in Gradle and to jar-in-jar it.

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    modImplementation include("com.github.ThePotatoArchivist:TagExclusion:${project.tagex_version}")
}

Note: For some reason, JitPack cannot have + in version names, so when specifying the version in Gradle you must use - instead, e.g. 1.0.0-mc1.21.11. The version in the mod metadata still uses +, only the maven version uses -.

Data Generation

To add tag exclusions in data generation, use the extension methods to TagAppender.

valueLookupBuilder(ItemTags.ANVIL)
        .tagex_exclude(Items.CHIPPED_ANVIL);

valueLookupBuilder(ItemTags.LOGS_THAT_BURN)
        .tagex_forceExcludeTag(ItemTags.DARK_OAK_LOGS);

If you're using Kotlin, there are also extension functions that don't have tagex_ in the name.

with (valueLookupBuilder(ItemTags.ANVIL)) {
    exclude(Items.CHIPPED_ANVIL)
}

To avoid messing with datagen when it's not supposed to, datagen will only produce tag entries in abbreviated form if the generating mod has specified its mod id for datagen and declares a hard dependency on tagex.

In build.gradle:

fabricApi {
    configureDataGeneration {
        // ...
        modId = "testmod"
    }
}

You may need to regenerate your IDE run configurations.

In fabric.mod.json:

{
  // ...
  "depends": {
    // ...
    "tagex": "^1.0.0"
  }
}

Screenshots

Gallery

  • Example of abbreviated tag syntax & removing entries
    Example of abbreviated tag syntax & removing entries

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works