First program
namespace demo
expose def add(a: int, b: int) -> int:
return a + b
Functions compile to internal ID-based functions. expose also creates a stable, named wrapper that other packs can call.
DATACRAFT V2
DataCraft compiles Python-like, indentation-based source into Minecraft Java Edition data-pack functions. Version 2 is the default when a source file has no version header.
namespace demo
expose def add(a: int, b: int) -> int:
return a + b
Functions compile to internal ID-based functions. expose also creates a stable, named wrapper that other packs can call.
DataCraft source files use the .dcraft extension. A project may contain several source files under its configured source directory; imports resolve across those files.
None is capitalized and only allowed by nullable types.bool is a restricted integer whose value is 0 or 1.