mcNows
Nows Loader 0.9.1 / Minecraft 26.2

mc Java Usage

Practical guide-style documentation for using Nows mc adapter Java APIs by topic.

Some APIs may still change or behave unevenly because they do not have enough real-world use cases and test coverage yet.

mc Java Usage

Start with the thing you are trying to build, then open the matching guide:

  • Stable Values explains McId, positions, directions, snapshots, stable item stacks and the rule for choosing stable wrappers over native Minecraft classes.
  • Registry And Content shows how to register items, blocks, block items, foods, tools, block entities, menus, sounds and creative tabs.
  • Text And NBT covers McText, TextApi, NbtCompound, NbtList, NbtValue and conversion to native Minecraft tags/components.
  • Client Keybinds covers the client/keybind package.
  • Client Config Screens covers the client/config package.
  • Client UI covers title-screen buttons and ScreenSpec.
  • Client Player covers the client/player package.
  • Commands And Events shows simple stable commands, Brigadier escape hatches and tick callbacks.
  • Data And Recipes covers generated data, tags, recipe specs and workstation recipe specs.
  • Recipe Viewer Metadata is optional display metadata for mods that need it.

Use the topic pages when writing mod code. They focus on API behavior and examples.

The Normal Mod Flow

Most code begins from MinecraftApi. It pulls the selected adapter’s service from NowsContext.

import space.nows.mc.api.MinecraftApi;
import space.nows.mc.api.registry.RegistryApi;
import space.nows.mc.api.text.TextApi;

public final class MyMod {
    public void onInitialize(NowsContext context) {
        RegistryApi registries = MinecraftApi.registries(context);
        TextApi text = MinecraftApi.text(context);

        registries.registerItem(ItemSpec.builder("my_mod:widget")
                .maxStackSize(16)
                .build());
    }
}

Use stable values for input. Accept native Minecraft return values when the mod needs to keep working with Minecraft directly.

BlockEntry machine = registries.registerBlockWithItem(
        BlockSpec.builder("my_mod:machine")
                .material(BlockMaterial.METAL)
                .strength(3.0F, 6.0F)
                .requiresCorrectTool()
                .item(ItemSpec.builder("my_mod:machine").build())
                .build());

That is the main style of the adapter API: describe common intent once, then let the selected Minecraft adapter translate it.