Skip to main content
The Crafting surface lets you verify recipe registrations and query the recipe registry. CraftingTestAdapter provides direct registry access, while CraftingAssert offers assertion methods that fail with clear messages when recipes are missing or counts fall short. Crafting tests are smoke tests for your mod’s content pipeline. If a recipe ID is misspelled in a JSON file or a new recipe fails to register, these tests catch it immediately instead of waiting for a player to discover the missing recipe in-game.

Complete Example Suite

Adapter Methods

MethodReturnsDescription
recipeExists(String recipeId)booleanCheck if a recipe with the given ID exists in the registry
listRecipeIds()List<String>List all registered recipe IDs
craftingPluginAvailable()booleanCheck if the crafting plugin class is present on the classpath

Assertion Methods

MethodFailure Message
assertRecipeExists(String recipeId)”Expected recipe ‘[recipeId]’ to exist in registry but it was not found”
assertRecipeCount(int minCount)”Expected at least [minCount] recipes but found [actual]“

Key Details

  • Both the assert and adapter classes use reflection to locate the recipe registry - no compile-time dependency on HytaleServer.jar is needed.
  • Use listRecipeIds() from CraftingTestAdapter to inspect the full registry contents when debugging a failing recipe assertion.
  • craftingPluginAvailable() is useful as a precondition check before running recipe-specific tests.

Next Steps