mcNows
Nows Loader 0.9.1 / Minecraft 26.2

Client Player

Read and update the local player through the mc adapter client/player package.

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

Client Player

The player API lives in space.nows.mc.api.client.player. It is client-only and talks to the local Minecraft player.

Read The Current Player

Use current() when the player may not exist yet, such as on the title screen or during loading.

MinecraftApi.player(context).current().ifPresent(player -> {
    LOGGER.debug("Native player: {}", player.getName().getString());
});

Use requireCurrent() only when absence is a programmer error.

Use A Stable Snapshot

snapshot() returns PlayerSnapshot, which contains stable values such as id, name, position, velocity, health, food, level and selected hotbar slot.

PlayerApi player = MinecraftApi.player(context);
PlayerSnapshot snapshot = player.snapshot();

LOGGER.info("{} at {}", snapshot.name(), snapshot.position());

Use snapshots for UI, callbacks and status checks. Use native LocalPlayer for deep client behavior.

Move Or Rotate

The API offers small movement helpers for local-player tools and debug features.

PlayerApi player = MinecraftApi.player(context);

player.setPosition(0.5D, 80.0D, 0.5D);
player.setRotation(180.0F, 0.0F);
player.setVelocity(McVec3.of(0.0D, 0.5D, 0.0D));

Be careful with these in normal gameplay. Server authority may correct the player after client-side movement changes.

Inventory Helpers

Use stable item stack specs for simple inventory changes.

player.addItem(ItemStackSpec.of("minecraft:diamond", 1));
player.setInventoryItem(0, McItemStack.of("my_mod:debug_tool"));
player.setSelectedHotbarSlot(0);

Use native inventory APIs for complex stack merging, capabilities, menus or server-synced inventory behavior.

Messages And Status

Send local messages with native components or stable McText.

player.sendSystemMessage(McText.literal("Machine ready"));
player.sendOverlayMessage(McText.translatable("message.my_mod.charged"));

Use server-side messaging APIs for multiplayer-authoritative messages.