Native API overview
The Native API is the API that Poly Mods use for Minecraft 26.2. All of it is PREVIEW, and it compiles against poly-lifecycle-api alone, with no Minecraft types. The implementation for each game version lives in Poly Mod Loader's game layer (poly-game-v26_2).
This section collects the most commonly used code and rules for each area. A full example that uses every area in one mod is examples/native-showcase-mod in the Poly Mod Loader source (private for now). That mod is also the reference mod for verifying behavior in the real game.
All APIs are PREVIEW
The 0.1 series has no STABLE API. The first public APIs stay PREVIEW until usage experience confirms them, and they may change between versions. The meaning of each level is in API stability.
Areas
Common rulesIDs, declaration timing, threads, server and clientLifecycle and threadsStartup order, registration close, shutdown tasks, threads per callbackBlocksBlock definitions, state properties, per-state light, behavior callbacksBlock entities and menusData, ticks, inventories, slot-layout menus and progress barsItemsItems, food, data components, real stack references, tooltipsTags and creative tabsTag queries, adding tag entries from code, a mod's own creative tabsGame rules, sounds, particlesGame rules, sounds, particle types, advancement triggersMobs and entitiesMob definitions, spawn eggs, natural spawning, projectilesAI goals and ridingAiGoal, MobView, movement and ridingMob modelsBox models and part animationDamage and status effectsCancelling and modifying damage, death events, status effectsWorldWorld views, storage, task scheduling, forced chunk loadingEventsAll event keys and listeners, priorities, decision results, interaction eventsWorld generationBiome features, data dimensions, code biomes and terrainCommands and permissionsBrigadier-based commands, permission nodes and providersNetworking and syncPayload channels, entity data and storage syncClientKey bindings, HUD, screens, drawingResources, data, operationsReload listeners, data versions, backupsSystem replacementSystemProvider, game brand, conflict rules
Packages
Package (dev.polymodloader.api.…) | Contents |
|---|---|
lifecycle | CommonModInitializer, ClientModInitializer, DedicatedServerModInitializer, ModContext |
stability | ApiStability, StabilityLevel — API stability level markers |
runtime | GameSide (CLIENT / DEDICATED_SERVER) |
system, system.brand | SystemId, PolySystem, SystemProvider, SystemContext, SystemLookup, GameBrandSystem — System replacement |
event, event.server, event.player, event.block, event.entity, event.world, event.interaction | Event keys and listeners, EventPriority, EventResult — Events |
content, content.block, content.block.state, content.block.entity, content.item, content.entity, content.entity.model, content.effect, content.rule, content.particle | Content definitions |
world, entity, inventory, data | World, entity and inventory views, and saved data |
tag | TagKey, TagRegistry, TagView — Tags and creative tabs |
worldgen | World generation |
command, permission | Commands and permissions |
network | Payload channels |
client | Client registration, screens, drawing |
resource | ResourceId, reload listeners |
devtools.gametest | In-game tests |