Skip to main content
Glama

teleport

Move players or entities to specific coordinates or other entities in Minecraft servers using target selectors and coordinate inputs.

Instructions

Teleport a player or entity to coordinates or another entity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget selector (e.g., '@a', '@p', 'PlayerName')
xNoX coordinate
yNoY coordinate
zNoZ coordinate
destinationNoDestination entity/player name (alternative to coordinates)

Implementation Reference

  • The handler function for the 'teleport' tool, which constructs and executes the Minecraft 'tp' command.
    async ({ target, x, y, z: zCoord, destination }) => {
      let cmd: string;
      if (destination) {
        cmd = `tp ${target} ${destination}`;
      } else if (x !== undefined && y !== undefined && zCoord !== undefined) {
        cmd = `tp ${target} ${x} ${y} ${zCoord}`;
      } else {
        return {
          content: [
            {
              type: "text",
              text: "Provide either coordinates (x, y, z) or a destination entity.",
            },
          ],
          isError: true,
        };
      }
      try {
        const response = await manager.rcon.send(cmd);
        return { content: [{ type: "text", text: response }] };
      } catch (error) {
  • The Zod schema definition for the 'teleport' tool input parameters.
    {
      target: z
        .string()
        .describe("Target selector (e.g., '@a', '@p', 'PlayerName')"),
      x: z.number().optional().describe("X coordinate"),
      y: z.number().optional().describe("Y coordinate"),
      z: z.number().optional().describe("Z coordinate"),
      destination: z
        .string()
        .optional()
        .describe("Destination entity/player name (alternative to coordinates)"),
    },
  • Registration of the 'teleport' tool with the MCP server.
    server.tool(
      "teleport",
      "Teleport a player or entity to coordinates or another entity.",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tamo2918/Minecraft-Server-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server