Skip to content

Instances

What is an Instance?

An instance is similar to a Minecraft Client. It holds all the data for a single client connection, along-side plugins.

What can I do with an Instance?

When using an Instance in a plugin, you're able to use all the features of the client with the typed methods.

Sending a Command

You can send a command to the server quite trivially. This is done using the sendChatCommand method on the instance.

ts
instance.sendChatCommand("/server survival");

Sending a Message

You can send messages into the chat using the sendChatMessage method on the instance.

ts
instance.sendChatMessage("Hello, World!");

API Specification

ts
declare class Instance {
    /**
     * This is the main method to send a command to the server.
     * @param command The command to send. Does not have to be prefixed with a slash.
     */
    public sendChatCommand(command: string): void;

    /**
     * This is the main method to send a message to the server chat.
     * @param message The message to send. Do not prefix with a slash.
     */
    public sendChatMessage(message: string): void;
}