> ## Documentation Index
> Fetch the complete documentation index at: https://docs.selvut.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Player, World, Input & Friend

> Game-state APIs available to scripts.

## Player

| Function                                                                    | Description                                                         |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `Player.getX()` / `getY()` / `getZ()`                                       | Player coordinates                                                  |
| `Player.position()`                                                         | `{ x, y, z, length }`                                               |
| `Player.eyePosition()`                                                      | Eye position vector                                                 |
| `Player.velocity()`                                                         | Velocity vector                                                     |
| `Player.yaw()` / `pitch()`                                                  | Current rotation                                                    |
| `Player.setYaw(yaw)` / `setPitch(pitch)`                                    | Set client rotation                                                 |
| `Player.setRotation(yaw, pitch)`                                            | Set client rotation                                                 |
| `Player.setVelocity(x, y, z)`                                               | Set velocity                                                        |
| `Player.stop()` / `stopHorizontal()`                                        | Clear velocity                                                      |
| `Player.jump()`                                                             | Jump                                                                |
| `Player.health()` / `maxHealth()` / `healthFraction()`                      | Wynn health values                                                  |
| `Player.isOnGround()` / `isCrouching()` / `isSprinting()` / `isUsingItem()` | State checks                                                        |
| `Player.isMoving()` / `speed()`                                             | Movement state                                                      |
| `Player.speedAttribute()`                                                   | `{ base, total }` vanilla MOVEMENT\_SPEED attribute, in blocks/tick |
| `Player.efficiencyAttribute()`                                              | `{ base, total }` vanilla MOVEMENT\_EFFICIENCY attribute            |
| `Player.maxSpeed()`                                                         | Theoretical steady-state top horizontal speed, in blocks/tick       |
| `Player.selectedSlot()`                                                     | Selected hotbar slot                                                |
| `Player.switchSlot(slot)`                                                   | Switch hotbar slot                                                  |
| `Player.heldItem()` / `hotbarItem(slot)`                                    | Item wrappers                                                       |
| `Player.findHotbarBlock()`                                                  | First hotbar block slot or `-1`                                     |
| `Player.getPlayer()`                                                        | Local player entity wrapper                                         |
| `Player.rayTraceEntity(reach?)`                                             | Targeted entity wrapper or `null`                                   |

Entity wrappers expose identity, type, display name, coordinates, rotations, previous position/rotation, velocity, bounding box, dimensions, health/absorption/armor/hurt fields, equipment, potion effects, network player info, distance helpers, common state flags, and `raw`.

Item wrappers expose item id, name, count, stack size, damage fields, block/stackable/enchantment flags, rarity, use animation, tooltip lines, enchantments, and `raw`.

Entity and item wrappers can be passed back into APIs that accept entities or items, such as render helpers, interaction helpers, and packet helpers.

## World

| Function                                 | Description                               |
| ---------------------------------------- | ----------------------------------------- |
| `World.isWorldLoaded()`                  | Whether a world is loaded                 |
| `World.time()`                           | World game time                           |
| `World.dimension()`                      | Current dimension string                  |
| `World.getBlock(x, y, z)`                | Block info object                         |
| `World.getEntities()`                    | Rendered entity wrappers                  |
| `World.getPlayers()`                     | Loaded player wrappers                    |
| `World.getEntityById(id)`                | Entity wrapper by runtime id              |
| `World.getNetworkPlayers()`              | Tab/network player info                   |
| `World.getScoreboard()`                  | Sidebar scoreboard, objectives, and teams |
| `World.getScoreboardEntries(objective?)` | Score entries for an objective or sidebar |
| `World.getTeams()`                       | Scoreboard teams keyed by team name       |
| `World.getObjectives()`                  | Scoreboard objective list                 |
| `World.distance(a, b)`                   | Distance between vectors/entities         |
| `World.rayTraceBlock()`                  | Targeted block info or `null`             |

Block info objects expose `x`, `y`, `z`, `id`, `name`, `state`, `air`, `solid`, and `raw`. They can be passed to `Render.block`, `Packet.useBlock`, and block action helpers.

## Input

| Function                    | Description                                |
| --------------------------- | ------------------------------------------ |
| `Input.isKeyDown(key)`      | Raw key state by key code or name          |
| `Input.isMouseDown(button)` | Mouse state by button code or name         |
| `Input.movement()`          | `{ forward, strafe, jump, sneak, sprint }` |

## Friend

| Function                              | Description        |
| ------------------------------------- | ------------------ |
| `Friend.list()`                       | Saved friends      |
| `Friend.isFriend(entityOrUuidOrName)` | Friend check       |
| `Friend.add(entityOrName)`            | Add online player  |
| `Friend.remove(entityOrUuidOrName)`   | Remove friend      |
| `Friend.name(uuid)`                   | Saved display name |
