Skip to main content
Version: 0.2.1

Interface IWukongConsoleApi

Namespace: WukongMp.Sdk.Api
Assembly: WukongMp.Sdk.dll

API for the in-game console (F1).

public interface IWukongConsoleApi

Methods​

AddCommand(string, ConsoleCommand, IEnumerable<string>?)​

Registers a command to the in-game console. The command will be available to all players in the session.

void AddCommand(string commandName, ConsoleCommand command, IEnumerable<string>? availableFirstParams = null)

Parameters​

commandName string

The name of the command that has to be typed in the console to execute the command.

command ConsoleCommand

Command handler

availableFirstParams IEnumerable<string>?

If specified, the console will show these as suggestions for the first parameter of the command. This is useful for commands that take a fixed set of parameters, such as "spawn wolf_sentinel".

HasCommand(string)​

Checks if a command with the given name is already registered in the console.

bool HasCommand(string commandName)

Parameters​

commandName string

Name of the command to check.

Returns​

bool

true if a command with the given name is registered, false otherwise.

LogMessage(string)​

Logs a message to the in-game console. This can be used to provide feedback to the player after executing a command, or to log important information that the player should see.

void LogMessage(string message)

Parameters​

message string

The message to log.

  • Methods
    • AddCommand(string, ConsoleCommand, IEnumerable<string>?)
    • HasCommand(string)
    • LogMessage(string)