Skip to content

TZY-1/SmeltableTag

Repository files navigation

Smeltable Tag Mod

A Minecraft NeoForge mod that dynamically adds item tags for all cookable items - covering Furnace, Blast Furnace, Smoker, and Campfire recipes.

What is this mod?

This mod creates fully dynamic item tags that automatically scan and include ALL items that can be cooked in any heating device - from vanilla AND all installed mods. Other mods can use these tags to filter or identify cookable items without hardcoding item lists.

Available Tags:

  • smeltabletag:smeltable - Items that can be smelted in a Furnace
  • smeltabletag:blastable - Items that can be processed in a Blast Furnace
  • smeltabletag:smokable - Items that can be cooked in a Smoker
  • smeltabletag:campfire_cookable - Items that can be cooked on a Campfire
  • smeltabletag:all_cookable - Combined tag containing all of the above

Use Cases:

  • Item filters in storage mods that support tag-based filtering
  • Automation mods that need to identify cookable items
  • Crafting/processing mods that work with cooking recipes
  • Any mod that benefits from knowing which items can be cooked

Features

  • Fully Dynamic: Automatically scans ALL cooking recipes on every server start
  • All Cooking Types: Supports Furnace, Blast Furnace, Smoker, and Campfire
  • Modpack Compatible: Works with ANY modpack - detects all modded cookable items
  • Auto-Updates: Adding/removing mods? Just restart the server - the tags update automatically
  • Debug Commands: Test and validate the tags in-game
  • Zero Configuration: Install and go - no manual setup required

Mod Information

  • Minecraft Version: 1.21.1
  • Mod Loader: NeoForge 21.1.217
  • Mod ID: smeltabletag
  • Tag IDs: smeltabletag:smeltable, smeltabletag:blastable, smeltabletag:smokable, smeltabletag:campfire_cookable, smeltabletag:all_cookable

Development Setup

Prerequisites

  • Java 21
  • Gradle (wrapper included)

Building the Mod

  1. Clone this repository
  2. Open in your IDE (IntelliJ IDEA or Eclipse recommended)
  3. Run gradlew build to build the mod
  4. Find the built JAR in build/libs/

That's it! No data generation needed - the mod works dynamically!

Running the Mod in Development

# Run Minecraft client with the mod loaded
gradlew runClient

# Run dedicated server with the mod loaded
gradlew runServer

Troubleshooting

If you encounter missing libraries or build issues:

gradlew --refresh-dependencies
gradlew clean

In-Game Commands

The mod provides the /cookable command to test and explore the tags:

General Commands (checks all cookable items):

  • /cookable check - Check if the item in your hand is cookable
  • /cookable count - Count all cookable items in your inventory
  • /cookable inventory - List all cookable items in your inventory
  • /cookable all - List all items in the all_cookable tag

Type-Specific Commands: Each cooking type has its own subcommand with the same options:

  • /cookable furnace <check|count|inventory|all> - Furnace (smeltable) items
  • /cookable blast <check|count|inventory|all> - Blast Furnace items
  • /cookable smoker <check|count|inventory|all> - Smoker items
  • /cookable campfire <check|count|inventory|all> - Campfire items

Using the Tags in Your Mod

Other mods can reference these tags to identify cookable items:

import com.teazy.smeltabletag.ModTags;

// Check if an item is cookable (any type)
boolean isCookable = itemStack.is(ModTags.Items.ALL_COOKABLE);

// Check specific cooking types
boolean isSmeltable = itemStack.is(ModTags.Items.SMELTABLE);        // Furnace
boolean isBlastable = itemStack.is(ModTags.Items.BLASTABLE);        // Blast Furnace
boolean isSmokable = itemStack.is(ModTags.Items.SMOKABLE);          // Smoker
boolean isCampfireCookable = itemStack.is(ModTags.Items.CAMPFIRE_COOKABLE); // Campfire

// Or reference by resource location
TagKey<Item> allCookableTag = TagKey.create(
    Registries.ITEM,
    ResourceLocation.fromNamespaceAndPath("smeltabletag", "all_cookable")
);

How It Works (Dynamic Generation)

  1. Server Starts: When the Minecraft server starts, ServerStartedEvent is fired
  2. Recipe Scanning: SmeltableTagGenerator scans the RecipeManager for ALL cooking recipes:
    • SmeltingRecipe (Furnace)
    • BlastingRecipe (Blast Furnace)
    • SmokingRecipe (Smoker)
    • CampfireCookingRecipe (Campfire)
  3. Datapack Creation: A dynamic datapack is created in world/datapacks/smeltabletag_generated/
  4. Tag Population: Five tag JSON files are generated with all discovered cookable items
  5. Auto-Loading: Minecraft loads this datapack automatically
  6. Ready to Use: Other mods can immediately use all smeltabletag:* tags

Result: Every time the server starts, all tags are regenerated with the current mod setup!

Project Structure

src/main/java/com/teazy/smeltabletag/
├── SmeltableTag.java           # Main mod class
├── ModTags.java                # Tag definitions (5 tags)
├── SmeltableTagGenerator.java  # Runtime recipe scanner & datapack generator
└── DebugCommandExtended.java   # /cookable command implementation

src/main/resources/
├── META-INF/neoforge.mods.toml       # Mod metadata
└── assets/smeltabletag/lang/en_us.json  # Localization

world/datapacks/smeltabletag_generated/  # Generated at runtime
├── pack.mcmeta
└── data/smeltabletag/tags/item/
    ├── smeltable.json        # Furnace items
    ├── blastable.json        # Blast Furnace items
    ├── smokable.json         # Smoker items
    ├── campfire_cookable.json # Campfire items
    └── all_cookable.json     # All cookable items combined

License

MIT License - See LICENSE file for details

Mapping Names

This mod uses the official mapping names from Mojang for methods and fields in the Minecraft codebase. These names are covered by a specific license. For the latest license text, refer to: https://github.com/NeoForged/NeoForm/blob/main/Mojang.md

Additional Resources

Credits

  • Author: Teazy
  • Version: 1.0.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages