Skip to content

ClickEvent

Namespace Mc.Scripting.Text · Kind struct (readonly)

public readonly struct ClickEvent : IEquatable<ClickEvent>

A click event of a text component.

Member Description
ClickEvent(ClickAction Action, string Value) A click event of a text component.
public ClickEvent(ClickAction Action, string Value)

A click event of a text component.

Parameters

Name Type Description
Action ClickAction What happens.
Value string Url / command / clipboard text / page number.
Member Description
ClickAction Action { get; init; } What happens.
string Value { get; init; } Url / command / clipboard text / page number.
public ClickAction Action { get; init; }

What happens.

public string Value { get; init; }

Url / command / clipboard text / page number.

Member Description
static ClickEvent ChangePage(int page) Change the book page.
static ClickEvent CopyToClipboard(string text) Copy text to the clipboard.
static ClickEvent OpenUrl(string url) Open a URL.
static ClickEvent RunCommand(string command) Run a command as the player (“/spawn”).
static ClickEvent SuggestCommand(string command) Suggest a command in the chat box.
public static ClickEvent ChangePage(int page)

Change the book page.

Parameters

Name Type Description
page int

Returns ClickEvent

public static ClickEvent CopyToClipboard(string text)

Copy text to the clipboard.

Parameters

Name Type Description
text string

Returns ClickEvent

public static ClickEvent OpenUrl(string url)

Open a URL.

Parameters

Name Type Description
url string

Returns ClickEvent

public static ClickEvent RunCommand(string command)

Run a command as the player (“/spawn”).

Parameters

Name Type Description
command string

Returns ClickEvent

public static ClickEvent SuggestCommand(string command)

Suggest a command in the chat box.

Parameters

Name Type Description
command string

Returns ClickEvent

ClickAction