API Reference
Anvil’s API is grouped by domain. Start with the relevant guide page for examples, then use these module references when you need the exact classes or functions.
Stability
anvil.api is Anvil's stable layer. Ready-made content built on top of it lives in the Kit, which is opinionated and may change between minor versions.
Content APIs
- Actors: Custom entity definitions, entity components, spawn rules, and materials.
- Blocks: Block definitions, block components, and custom behaviors.
- Items: Item definitions, item components, and crafting / brewing recipes.
- Models: Geometry, animation, and voxel shape files built in code.
Runtime APIs
- Logic: Molang query and expression wrappers.
- World: Loot tables, trade tables, dialogues, particles, features, dimensions and jigsaw structures.
- Camera: Camera presets and aim assist.
- Sounds: Sound definitions, sound events and music.
- Textures: Item and terrain atlases and flipbooks.
- Biomes: Biome definitions and components.
- UI: UI and HUD manipulation.
- PBR: Physical-based rendering, texture sets, and material properties.
- Vanilla: Reference identifiers for vanilla Minecraft entities, items, and blocks.
Core Library
- Config: Anvil project configuration and settings.
- Types: Type definitions, vectors, and identifiers.
- Enums: Enums for components, slots, operations, and states.
- Filters: Minecraft test filters builder.
- Lib: Core utility functions and I/O helpers.
- Reports: Build reporting and analytics.
- Manifest: Pack manifests and world settings.
- Scaffold: The npm, TypeScript, VS Code and workflow files of a project.
- Translator: Language localization helpers.
- Blockbench: Blockbench geometry and animation importers.
- Format Versions: Minecraft Bedrock format version helpers.