ClickEvent
Namespace Mc.Scripting.Text · Kind struct (readonly)
public readonly struct ClickEvent : IEquatable<ClickEvent>A click event of a text component.
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
ClickEvent(ClickAction Action, string Value) |
A click event of a text component. |
Constructor
Section titled “Constructor”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. |
Properties
Section titled “Properties”| Member | Description |
|---|---|
ClickAction Action { get; init; } |
What happens. |
string Value { get; init; } |
Url / command / clipboard text / page number. |
Action
Section titled “Action”public ClickAction Action { get; init; }What happens.
public string Value { get; init; }Url / command / clipboard text / page number.
Methods
Section titled “Methods”| 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. |
ChangePage
Section titled “ChangePage”public static ClickEvent ChangePage(int page)Change the book page.
Parameters
| Name | Type | Description |
|---|---|---|
page |
int |
Returns ClickEvent
CopyToClipboard
Section titled “CopyToClipboard”public static ClickEvent CopyToClipboard(string text)Copy text to the clipboard.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns ClickEvent
OpenUrl
Section titled “OpenUrl”public static ClickEvent OpenUrl(string url)Open a URL.
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
Returns ClickEvent
RunCommand
Section titled “RunCommand”public static ClickEvent RunCommand(string command)Run a command as the player (“/spawn”).
Parameters
| Name | Type | Description |
|---|---|---|
command |
string |
Returns ClickEvent
SuggestCommand
Section titled “SuggestCommand”public static ClickEvent SuggestCommand(string command)Suggest a command in the chat box.
Parameters
| Name | Type | Description |
|---|---|---|
command |
string |
Returns ClickEvent