Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Legendreliclib Wiki › Guides › Organize Items and Blocks Using Tag Helper Tools

Organize Items and Blocks Using Tag Helper Tools

Tag Helpers Explained

LegendRelicLib includes utilities to quickly check whether an item or block belongs to a specific category using tags. Instead of writing conditional checks for every individual item, you can group them logically.

Using Tags in Your Mod

1. Define your tag categories based on item properties (e.g., "legendary_weapons", "fire_resistant_blocks")

2. Use the tag helper functions to check if an item or block matches a tag in your code

3. Apply logic based on tags—for example, only legendary weapons trigger special abilities, or only fire-resistant blocks survive lava

4. Update tags easily without rewriting code; just add or remove items from the tag list

Practical Example

If you're creating a mod that gives bonus damage against certain enemy types, tag helpers let you mark which weapons qualify. When a player attacks, the game checks the tag instead of hardcoding item IDs. This makes your mod compatible with other mods that add similar items.