|
2 | 2 | title: Actions |
3 | 3 | description: Add click actions to your characters. |
4 | 4 | --- |
| 5 | + |
| 6 | +You can manage character actions using the `/character action` command. |
| 7 | +`/character action [add|cooldown|list|permission|remove] ...` |
| 8 | + |
| 9 | +## Adding an Action [#add] |
| 10 | + |
| 11 | +Actions are triggered by specific click types. To add a new action to a character use command |
| 12 | +`/character action add <character> <action> <click-type> <action-type> <parameters>`. |
| 13 | + |
| 14 | +Existing actions can be overwritten by using the same `<action>` name. |
| 15 | + |
| 16 | +### Click Types |
| 17 | + |
| 18 | +The following click types can be used for the `<click-type>` argument: |
| 19 | + |
| 20 | +- `any_click`: Any left or right click (with or without shift) |
| 21 | +- `any_left_click`: Any left click (normal or shift) |
| 22 | +- `any_right_click`: Any right click (normal or shift) |
| 23 | +- `left_click`: Left click only |
| 24 | +- `right_click`: Right click only |
| 25 | +- `shift_click`: Any shift click (left or right) |
| 26 | +- `shift_left_click`: Shift + left click only |
| 27 | +- `shift_right_click`: Shift + right click only |
| 28 | + |
| 29 | +Use these to specify when the action should be triggered. |
| 30 | + |
| 31 | +### Action Types & Parameters [#action-types] |
| 32 | + |
| 33 | +| Action Type | Parameters | |
| 34 | +| ------------------- | ----------------------------------------------------------------------------- | |
| 35 | +| connect | `<server>` (BungeeCord/Velocity Server Name) | |
| 36 | +| play-sound | `<sound> <sound-source> <volume> <pitch>` | |
| 37 | +| run-console-command | `<command>` | |
| 38 | +| run-command | `<command>` | |
| 39 | +| send-actionbar | `<message>` (MiniMessage Supported) | |
| 40 | +| send-entity-effect | `<entity-effect>` | |
| 41 | +| send-message | `<message>` (MiniMessage Supported) | |
| 42 | +| teleport | `<position> [<rotation>] [<world>]` | |
| 43 | +| send-title | `<title> [<subtitle>] [<fade-in>] <stay> <fade-out> ` (MiniMessage Supported) | |
| 44 | +| transfer | `<hostname> [<port>]` | |
| 45 | + |
| 46 | +<Callout type="info"> |
| 47 | +Using `<player>` in a parameter will be replaced with the name of the player who triggered the action. |
| 48 | +</Callout> |
| 49 | + |
| 50 | +### Example [!toc] [#add-example] |
| 51 | + |
| 52 | +To add a greeting action to a character named "Steve", use the following command: |
| 53 | + |
| 54 | +``` |
| 55 | +/character action add Steve greet any_click send-message Hello, <player>! |
| 56 | +``` |
| 57 | + |
| 58 | +This action will be triggered on any click and sends `Hello, NonSwag!` if the player's name is NonSwag. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Cooldowns |
| 63 | + |
| 64 | +Set or view the cooldown for your characters actions. |
| 65 | +The cooldown determines how fast an action can be triggered. |
| 66 | + |
| 67 | +Usage: `/character action cooldown <character> <action> [<duration>]` |
| 68 | + |
| 69 | +- `[<duration>]`: Time in ticks (unless specified otherwise). |
| 70 | + Use `0` to remove the cooldown. Omit to view the current cooldown. |
| 71 | + |
| 72 | +### Set a Cooldown |
| 73 | + |
| 74 | +To set a cooldown for an action, use the command: |
| 75 | +`/character action cooldown <character> <action> <duration>` |
| 76 | + |
| 77 | +<Callout type="info">A duration of `0` will remove the cooldown for the action.</Callout> |
| 78 | + |
| 79 | +#### Example [!toc] [#cooldown-set-example] |
| 80 | + |
| 81 | +``` |
| 82 | +/character action cooldown Steve greet 10s |
| 83 | +``` |
| 84 | + |
| 85 | +This sets a cooldown of **10 seconds** for the **greet** action of the character **Steve**. |
| 86 | + |
| 87 | +### View Current Cooldown |
| 88 | + |
| 89 | +To view the current cooldown for an action, use the command |
| 90 | +`/character action cooldown <character> <action>`. |
| 91 | + |
| 92 | +#### Example [!toc] [#cooldown-view-example] |
| 93 | + |
| 94 | +``` |
| 95 | +/character action cooldown Steve greet |
| 96 | +``` |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Permissions |
| 101 | + |
| 102 | +Set, remove, or view the required permission for a character's action. |
| 103 | +If a permission is set, only players with that permission can trigger the action. |
| 104 | + |
| 105 | +### Define a Permission |
| 106 | + |
| 107 | +To define a permission for an action, use the command |
| 108 | +`/character action permission <character> <action> set <permission>`. |
| 109 | + |
| 110 | +#### Example [!toc] [#permission-set-example] |
| 111 | + |
| 112 | +``` |
| 113 | +/character action permission Steve greet set warm.welcome.permission |
| 114 | +``` |
| 115 | + |
| 116 | +### Remove a Permission |
| 117 | + |
| 118 | +To remove a permission for an action, use the command |
| 119 | +`/character action permission <character> <action> remove`. |
| 120 | + |
| 121 | +#### Example [!toc] [#permission-remove-example] |
| 122 | + |
| 123 | +``` |
| 124 | +/character action permission Steve greet remove |
| 125 | +``` |
| 126 | + |
| 127 | +### View Current Permission |
| 128 | + |
| 129 | +To view the current permission for an action, use the command |
| 130 | +`/character action permission <character> <action>`. |
| 131 | + |
| 132 | +#### Example [!toc] [#permission-view-example] |
| 133 | + |
| 134 | +``` |
| 135 | +/character action permission Steve greet |
| 136 | +``` |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## Removing an Action |
| 141 | + |
| 142 | +To remove a specific action from a character, use the command |
| 143 | +`/character action remove <character> <action>`. |
| 144 | + |
| 145 | +**Example Command:** |
| 146 | + |
| 147 | +``` |
| 148 | +/character action remove Steve greet |
| 149 | +``` |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## List all Actions |
| 154 | + |
| 155 | +List all actions configured for a character using `/character action list <character>`. |
| 156 | + |
| 157 | +### Example [!toc] |
| 158 | + |
| 159 | +``` |
| 160 | +/character action list Steve |
| 161 | +
|
| 162 | +``` |
0 commit comments