Skip to main content

Client and chat

The ctx.client API lets you send messages and effects to the player’s Minecraft client, or send messages to the server as if the player typed them.

Sending chat to the player

Messages that appear in the player’s chat (as if the server sent them):
Use § color codes for formatting (e.g. §a green, §c red, §e yellow, §7 gray).

Sending chat to the server (as the player)

Use this to type in chat or run commands as the player:
  • sendChat(message) - Message to the player’s client (visible in their chat).
  • sendGameChat(message) - Message to the server (Hypixel); appears as if the player typed it. Use for “glhf”, “gg”, or /play ... etc.

Titles and action bar

  • sendTitle(title, subtitle?, options?) - Title and optional subtitle. options: fadeIn, stay, fadeOut (in ticks; default 10, 70, 20).
  • sendActionBar(message) - Text above the hotbar (good for live stats).

Sounds

  • playSound(name, volume?, pitch?) - Plays a sound for the player. volume 0–1 (default 1), pitch multiplier (default 1). Use Minecraft resource names (e.g. random.levelup, mob.villager.death, note.harp).

When to use which

Advanced

  • sendPacket(name, data) - Send an arbitrary packet to the player’s client (advanced).
  • sendServerPacket(name, data) - Send an arbitrary packet to the server (advanced).
  • disconnect(reason?) - Disconnect the player from the proxy.
All of these no-op or fail gracefully if no player is connected (ctx.client.isConnected is false). You can read ctx.client.username and ctx.client.uuid when connected.