Methods
close
- close(): Promise<void>
-
Returns Promise<void>
joinProxyClient
- joinProxyClient(proxyClient: ProxyClient): void
-
Returns void
on
- on(event: "listening", callback: (() => void)): void
-
Parameters
-
event: "listening"
-
callback: (() => void)
Returns void
- on(event: "join" | "leave" | "connect", callback: ((client: Client) => void)): void
-
Parameters
-
event: "join" | "leave" | "connect"
-
callback: ((client: Client) => void)
-
- (client: Client): void
-
Returns void
Returns void
- on(event: "error", callback: ((customError: CustomError) => void)): void
-
Parameters
-
event: "error"
-
callback: ((customError: CustomError) => void)
Returns void
once
- once(event: "listening", callback: (() => void)): void
-
Parameters
-
event: "listening"
-
callback: (() => void)
Returns void
- once(event: "join" | "leave" | "connect", callback: ((client: Client) => void)): void
-
Parameters
-
event: "join" | "leave" | "connect"
-
callback: ((client: Client) => void)
-
- (client: Client): void
-
Returns void
Returns void
- once(event: "error", callback: ((customError: CustomError) => void)): void
-
Parameters
-
event: "error"
-
callback: ((customError: CustomError) => void)
Returns void
Constructors
constructor
- new Server(serverOptions: {
defaultClientProperties?(client: Client): defaultClientProperties;
serverList?(info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: null | version;
}): {
description?: Text | optionalTextArray;
favicon?: Buffer;
players?: {
hover?: string | {
name: string;
uuid: string;
}[];
max?: number;
online?: number;
};
version?: {
correct?: version;
wrongText?: string | Text;
};
};
wrongVersionConnect?(info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: newVersion | "legacy";
}): null | string | Text;
}): Server
-
Parameters
-
serverOptions: {
defaultClientProperties?(client: Client): defaultClientProperties;
serverList?(info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: null | version;
}): {
description?: Text | optionalTextArray;
favicon?: Buffer;
players?: {
hover?: string | {
name: string;
uuid: string;
}[];
max?: number;
online?: number;
};
version?: {
correct?: version;
wrongText?: string | Text;
};
};
wrongVersionConnect?(info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: newVersion | "legacy";
}): null | string | Text;
}
-
defaultClientProperties?:function
-
serverList?:function
- serverList(info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: null | version;
}): {
description?: Text | optionalTextArray;
favicon?: Buffer;
players?: {
hover?: string | {
name: string;
uuid: string;
}[];
max?: number;
online?: number;
};
version?: {
correct?: version;
wrongText?: string | Text;
};
}
-
Parameters
-
info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: null | version;
}
-
connection: {
host: null | string;
port: null | number;
}
-
host: null | string
-
port: null | number
-
ip: string
-
legacy: boolean
-
version: null | version
Returns {
description?: Text | optionalTextArray;
favicon?: Buffer;
players?: {
hover?: string | {
name: string;
uuid: string;
}[];
max?: number;
online?: number;
};
version?: {
correct?: version;
wrongText?: string | Text;
};
}
-
-
Optional
favicon?: Buffer
-
Optional
players?: {
hover?: string | {
name: string;
uuid: string;
}[];
max?: number;
online?: number;
}
-
Optional
hover?: string | {
name: string;
uuid: string;
}[]
-
Optional
max?: number
-
Optional
online?: number
-
Optional
version?: {
correct?: version;
wrongText?: string | Text;
}
-
Optional
correct?: version
-
Optional
wrongText?: string | Text
-
wrongVersionConnect?:function
- wrongVersionConnect(info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: newVersion | "legacy";
}): null | string | Text
-
Parameters
-
info: {
connection: {
host: null | string;
port: null | number;
};
ip: string;
legacy: boolean;
version: newVersion | "legacy";
}
-
connection: {
host: null | string;
port: null | number;
}
-
host: null | string
-
port: null | number
-
ip: string
-
legacy: boolean
-
Returns null | string | Text
See
https://oscarnow.github.io/minecraft-server/1.4.0/classes/Server
Example
const server = new Server({