Skip to content

@minecraft/server

💡 Easy Explain

The world object is your main gateway to everything happening in the server. You use this to get players, read dimensions (like Overworld or Nether), change times, and broadcast messages. Think of it as the "God Mode" remote control for your server environment.

🎮 Code Examples ​

Broadcast message and play sound

javascript
import { world } from "@minecraft/server";

// Send message to all connected players
world.sendMessage("Hello everyone! Server will restart in 5 minutes.");

// Play level up sound to all players
world.playSound("random.levelup");


@minecraft/server / world

Variable: world ​

const world: World

Defined in: @minecraft/server/index.d.ts:25638

Remarks ​

A class that wraps the state of a world - a set of dimensions and the environment of Minecraft.