EasySign: Difference between revisions
m (Reverted edits by Totemo (talk) to last revision by Silversunset) |
|||
Line 1: | Line 1: | ||
EasySigns is a plugin that makes signs perform actions when (left-or-right) clicked. | |||
Any player can activate a sign. Only staff are permitted to configure sign actions. | |||
== Sign Actions == | |||
Staff-facing commands can be used to edit a list of actions associated with any sign. That list constitutes a simple "script" or "program". Actions are numbered in the order they were added to the sign, and are executed in numerical order. The plugin has commands to re-order actions and remove selected actions from the list. | |||
The actions performed by a sign are not affected by the visible text on the sign. Examples of frequently used actions would be: | |||
* to send the player a message, | |||
* to set their bed spawn location, or | |||
* teleport the player to another location. | |||
Signs can also check certain conditions, such as how many times the sign has been clicked, and then decide not to execute subsequent actions in the list. | |||
== In-Game Help == | |||
You can list documentation on all possible sign actions by running <code>/easy-sign</code> with no command arguments. This will also show brief documentation on related commands and provide a link to this wiki page. | |||
== Adding An Action == | |||
To add an action to a sign, look at it, and run <code>/easy-sign <type> [<args>]</code>, where the <type> is one of those described in the following table. | |||
Actions marked with † are only available in the EasySigns plugin (PvE rev 24+) and not in the original CommandHelper implementation of the feature. | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 40: | Line 35: | ||
! scope="col" text-align="center"| Usage | ! scope="col" text-align="center"| Usage | ||
|- | |- | ||
| style="white-space: nowrap;" | Announce || /easy-sign announce <id> <message> || Announces in-game | | style="white-space: nowrap;" | Announce || /easy-sign announce <id> <message> <br>† /easy-sign announce <message> || Announces in-game. The message is broadcast only once when the player clicks the sign. Supports /signtext colors and %s is replaced with the player's name. The ID sets the 'key' for the sign group, players can only announce once per group. † In the EasySigns plugin, the <id> must be omitted; the location of the sign identifies it. | ||
|- | |- | ||
| style="white-space: nowrap;" | Bed (Set) || /easy-sign setbed [<world>] x y z || Sets the | | style="white-space: nowrap;" | Bed (Set) || /easy-sign setbed [<world>] x y z || Sets the player's bed location at the specified position. | ||
|- | |- | ||
| style="white-space: nowrap;" | Bed ( | | style="white-space: nowrap;" | Bed (Set) || /easy-sign sleep || Sets the player's bed location to their location when they clicked the sign. | ||
|- | |- | ||
| style="white-space: nowrap;" | | | style="white-space: nowrap;" | Bed (Teleport) || /easy-sign tpbed || Teleports the player back to their bed. | ||
|- | |- | ||
| style="white-space: nowrap;" | Command || /easy-sign cmd <command> || | | style="white-space: nowrap;" | Cart || /easy-sign cart [<world>] x y z || Spawns a minecart at the specified location. | ||
|- | |||
| style="white-space: nowrap;" | Command || /easy-sign cmd <command> || Runs the command as the user. Omit the leading slash. | |||
|- | |- | ||
| style="white-space: nowrap;" | Give || /easy-sign give <item> <qty> [<slot>] || gives the player an item | | style="white-space: nowrap;" | Give || /easy-sign give <item> <qty> [<slot>] || gives the player an item | ||
|- | |- | ||
| style="white-space: nowrap;" | Give Held || /easy-sign giveheld [<slot>] || | | style="white-space: nowrap;" | Give Held || /easy-sign giveheld [<slot>] || Gives the player a duplicate of your currently held item. † In the plugin version, this command is /easy-sign give held [<slot>] | ||
|- | |- | ||
| style="white-space: nowrap;" | Give Max || /easy-sign givemax <id> <item> <qty> <max gives> [<slot>] || gives the player max # of an item | | style="white-space: nowrap;" | Give Max || /easy-sign givemax <id> <item> <qty> <max gives> [<slot>] || gives the player max # of an item | ||
|- | |- | ||
| style="white-space: nowrap;" | Heal || /easy-sign heal [<gap>] || | | style="white-space: nowrap;" | Heal || /easy-sign heal [<gap>] || Refills a player's health. If a gap is specified then the player gets half a heart every gap (can be a decimal) seconds. The default gap of 0 instantly heals all damage. | ||
|- | |- | ||
| style="white-space: nowrap;" | Hunger || /easy-sign hunger || | | style="white-space: nowrap;" | Hunger || /easy-sign hunger || Refills a player's hunger bar. | ||
|- | |- | ||
| style="white-space: nowrap;" | Inventory (Check for Empty) || /easy-sign check-empty-inventory [<message>] || If the player's inventory is not empty, do not execute any subsequent sign actions and show <message>, if specified, or a default message. Default message: Your inventory must be completely empty to use this. | | style="white-space: nowrap;" | Inventory (Check for Empty) || /easy-sign check-empty-inventory [<message>] || If the player's inventory is not empty, do not execute any subsequent sign actions and show <message>, if specified, or a default message. Default message: Your inventory must be completely empty to use this. | ||
|- | |- | ||
| style="white-space: nowrap;" | Inventory (Clear) || /easy-sign ci || | | style="white-space: nowrap;" | Inventory (Clear) || /easy-sign ci || Clears the player's inventory. | ||
|- | |- | ||
| style="white-space: nowrap;" | Inventory (Drop) || /easy-sign dropinventory [scatter] [<world>] x y z || Drops a copy of your current inventory at the specified coordinates. Specify 'scatter' as the first argument to give the dropped items random velocities | | style="white-space: nowrap;" | Inventory (Drop) || /easy-sign dropinventory [scatter] [<world>] x y z<br>† /easy-sign dropinventory [<world>] x y z [scatter] || Drops a copy of your current inventory at the specified coordinates. Specify 'scatter' as the first argument to give the dropped items random velocities. † For the plugin version, <scatter> is the last argument and is either true (to scatter drops) or false. | ||
|- | |- | ||
| style="white-space: nowrap;" | Inventory (Give) || /easy-sign giveinventory || Gives the player the items in your inventory, filling the empty space | | style="white-space: nowrap;" | Inventory (Give) || /easy-sign giveinventory || Gives the player the items in your inventory, filling the empty space | ||
|- | |- | ||
| style="white-space: nowrap;" | Inventory (Replace) || /easy-sign inventory || Clears the | | style="white-space: nowrap;" | Inventory (Replace) || /easy-sign inventory || Clears the player's inventory and gives them an exact copy of your current inventory | ||
|- | |- | ||
| style="white-space: nowrap;" | Launch || /easy-sign launch x y z || Launches the player with the specified velocity vector. | | style="white-space: nowrap;" | Launch || /easy-sign launch x y z || Launches the player with the specified velocity vector. | ||
Line 78: | Line 75: | ||
| style="white-space: nowrap;" | Max (uses) || /easy-sign max <id> <uses> || Allows the sign to be used <uses> items and no more. No other commands will run when limit is reached | | style="white-space: nowrap;" | Max (uses) || /easy-sign max <id> <uses> || Allows the sign to be used <uses> items and no more. No other commands will run when limit is reached | ||
|- | |- | ||
| style="white-space: nowrap;" | Message || /easy-sign msg <message> || Sends the player a message. Color codes with & are supported | | style="white-space: nowrap;" | Message || /easy-sign msg <message> || Sends the player a message. Color codes with & are supported. See [[EasySign#Formatting Codes|Formatting Codes]]. | ||
|- | |- | ||
| style="white-space: nowrap;" | Potion || /easy-sign potion <id> <strength> <seconds> || applies a potion effect to the player. <ID> must be 1-23 < | | style="white-space: nowrap;" | Potion || /easy-sign potion <id> <strength> <seconds> || applies a potion effect to the player. <ID> must be 1-23 <strength> has a minimum level of 1 [http://minecraft.gamepedia.com/Status_effect These potion effects] can be used. | ||
|- | |- | ||
| style="white-space: nowrap;" | Potion (clear) || /easy-sign clearpotions || Clears all potion effects | | style="white-space: nowrap;" | Potion (clear) || /easy-sign clearpotions || Clears all potion effects. | ||
|- | |- | ||
| style="white-space: nowrap;" | Random Location || /easy-sign randloc <max_distance> || Randomly spawns the player max_distance away from 0,0 | | style="white-space: nowrap;" | Random Location || /easy-sign randloc <max_distance> || Randomly spawns the player max_distance away from 0,0 | ||
|- | |- | ||
| style="white-space: nowrap;" | Take || /easy-sign take <item> <qty> <failmsg> || takes an item from the player. If they dont have enough a failmsg is shown and no other commands are run | | style="white-space: nowrap;" | Take || /easy-sign take <item> <qty> <failmsg> || takes an item from the player. If they dont have enough a failmsg is shown and no other commands are run | ||
Line 93: | Line 88: | ||
|- | |- | ||
|} | |} | ||
== Listing A Sign's Actions == | |||
To list all the actions on the sign, look at it and run <code>/easy-sign-info</code>. Each action will have a number in this list. The number can be supplied to other EasySigns commands in order to alter that action. | |||
== Removing Actions == | |||
To remove one action from a sign, look at it and run <code>/easy-sign-remove <number></code>, specifying the 1-based list position of the action, as shown by <code>/easy-sign-info</code>. | |||
To remove <i>all actions</i> from a sign, look at it and run <code>/easy-sign-delete</code>, or simply break the sign. | |||
== Reordering Sign Actions == | |||
To move an action from one position to another in the order, use <code>/easy-sign-reorder <from> <to></code>, where: | |||
* <from> is the list position number of the action to be moved, | |||
* <to> is the new list position to insert the action. | |||
The action at the <to> position prior to executing the command, and all subsequent actions, will be moved down one position in the list. | |||
For example, if the current actions on a sign are: | |||
<span STYLE="font-size: 7pt"><pre> | |||
(1) sound ENTITY_IRON_GOLEM_DEATH 1.00 1.00 | |||
(2) heal 2 | |||
(3) sleep | |||
(4) msg Hi</pre></span> | |||
then <code>/easy-sign-reorder 3 1</code> will change the actions to be: | |||
<span STYLE="font-size: 7pt"><pre> | |||
(1) sleep | |||
(2) sound ENTITY_IRON_GOLEM_DEATH 1.00 1.00 | |||
(3) heal 2 | |||
(4) msg Hi</pre></span> | |||
== Formatting Codes == | |||
The <code>msg</code> and <code>announce</code> actions support Minecraft formatting codes beginning with the ampersand, <code>&</code>. | |||
Two <code>&</code> characters in succession adds a single ampersand to the message. | |||
The <code>/signtext</code> command shows a guide to colour codes in chat. | |||
Minecraft's formatting codes are documented in the [https://minecraft.gamepedia.com/Formatting_codes Minecraft Wiki Formatting Codes article]. | |||
== Source Code == | |||
The source code and technical information are available at https://github.com/NerdNu/EasySigns. |
Revision as of 07:57, 15 August 2019
EasySigns is a plugin that makes signs perform actions when (left-or-right) clicked.
Any player can activate a sign. Only staff are permitted to configure sign actions.
Sign Actions
Staff-facing commands can be used to edit a list of actions associated with any sign. That list constitutes a simple "script" or "program". Actions are numbered in the order they were added to the sign, and are executed in numerical order. The plugin has commands to re-order actions and remove selected actions from the list.
The actions performed by a sign are not affected by the visible text on the sign. Examples of frequently used actions would be:
- to send the player a message,
- to set their bed spawn location, or
- teleport the player to another location.
Signs can also check certain conditions, such as how many times the sign has been clicked, and then decide not to execute subsequent actions in the list.
In-Game Help
You can list documentation on all possible sign actions by running /easy-sign
with no command arguments. This will also show brief documentation on related commands and provide a link to this wiki page.
Adding An Action
To add an action to a sign, look at it, and run /easy-sign <type> [<args>]
, where the <type> is one of those described in the following table.
Actions marked with † are only available in the EasySigns plugin (PvE rev 24+) and not in the original CommandHelper implementation of the feature.
Name | Command | Usage |
---|---|---|
Announce | /easy-sign announce <id> <message> † /easy-sign announce <message> |
Announces in-game. The message is broadcast only once when the player clicks the sign. Supports /signtext colors and %s is replaced with the player's name. The ID sets the 'key' for the sign group, players can only announce once per group. † In the EasySigns plugin, the <id> must be omitted; the location of the sign identifies it. |
Bed (Set) | /easy-sign setbed [<world>] x y z | Sets the player's bed location at the specified position. |
Bed (Set) | /easy-sign sleep | Sets the player's bed location to their location when they clicked the sign. |
Bed (Teleport) | /easy-sign tpbed | Teleports the player back to their bed. |
Cart | /easy-sign cart [<world>] x y z | Spawns a minecart at the specified location. |
Command | /easy-sign cmd <command> | Runs the command as the user. Omit the leading slash. |
Give | /easy-sign give <item> <qty> [<slot>] | gives the player an item |
Give Held | /easy-sign giveheld [<slot>] | Gives the player a duplicate of your currently held item. † In the plugin version, this command is /easy-sign give held [<slot>] |
Give Max | /easy-sign givemax <id> <item> <qty> <max gives> [<slot>] | gives the player max # of an item |
Heal | /easy-sign heal [<gap>] | Refills a player's health. If a gap is specified then the player gets half a heart every gap (can be a decimal) seconds. The default gap of 0 instantly heals all damage. |
Hunger | /easy-sign hunger | Refills a player's hunger bar. |
Inventory (Check for Empty) | /easy-sign check-empty-inventory [<message>] | If the player's inventory is not empty, do not execute any subsequent sign actions and show <message>, if specified, or a default message. Default message: Your inventory must be completely empty to use this. |
Inventory (Clear) | /easy-sign ci | Clears the player's inventory. |
Inventory (Drop) | /easy-sign dropinventory [scatter] [<world>] x y z † /easy-sign dropinventory [<world>] x y z [scatter] |
Drops a copy of your current inventory at the specified coordinates. Specify 'scatter' as the first argument to give the dropped items random velocities. † For the plugin version, <scatter> is the last argument and is either true (to scatter drops) or false. |
Inventory (Give) | /easy-sign giveinventory | Gives the player the items in your inventory, filling the empty space |
Inventory (Replace) | /easy-sign inventory | Clears the player's inventory and gives them an exact copy of your current inventory |
Launch | /easy-sign launch x y z | Launches the player with the specified velocity vector. |
Leather | /easy-sign leather <red> <green> <blue> <item1> ... <itemN> | gives the player leather armor with the specificed red, green, and blue color components (0-255). <item1> to <itemN> are a list of items to give and can only be: helmet, chestplte, leggings, or boots |
Lore | /easy-sign lore <item> <qty> <lore>||<itemmsg>||<qtymsg> | Takes a specified qty of an item from a player if it has the required lore. Colors are ignored and lines are concatenated without spaces. The item must be in the players hand. If the wrong item is held <itemmsg> is shown. If it is the right item but insufficient qty <qtymsg> is shown. The <itemmsg> and <qtymsg> can be multiple words and color codes are allowed. The double bar seq || is used to separate those arguments. If the item is not taken for whatever reason, subsuquent sign actions are not processed. Caution: multiple consecutive spaces in any of these strings will be replaced with single spaces |
Max (uses) | /easy-sign max <id> <uses> | Allows the sign to be used <uses> items and no more. No other commands will run when limit is reached |
Message | /easy-sign msg <message> | Sends the player a message. Color codes with & are supported. See Formatting Codes. |
Potion | /easy-sign potion <id> <strength> <seconds> | applies a potion effect to the player. <ID> must be 1-23 <strength> has a minimum level of 1 These potion effects can be used. |
Potion (clear) | /easy-sign clearpotions | Clears all potion effects. |
Random Location | /easy-sign randloc <max_distance> | Randomly spawns the player max_distance away from 0,0 |
Take | /easy-sign take <item> <qty> <failmsg> | takes an item from the player. If they dont have enough a failmsg is shown and no other commands are run |
Warp | /easy-sign warp [<world>] x y z | sends player to coordinates listed, <world> is optional |
Listing A Sign's Actions
To list all the actions on the sign, look at it and run /easy-sign-info
. Each action will have a number in this list. The number can be supplied to other EasySigns commands in order to alter that action.
Removing Actions
To remove one action from a sign, look at it and run /easy-sign-remove <number>
, specifying the 1-based list position of the action, as shown by /easy-sign-info
.
To remove all actions from a sign, look at it and run /easy-sign-delete
, or simply break the sign.
Reordering Sign Actions
To move an action from one position to another in the order, use /easy-sign-reorder <from> <to>
, where:
- <from> is the list position number of the action to be moved,
- <to> is the new list position to insert the action.
The action at the <to> position prior to executing the command, and all subsequent actions, will be moved down one position in the list.
For example, if the current actions on a sign are:
(1) sound ENTITY_IRON_GOLEM_DEATH 1.00 1.00 (2) heal 2 (3) sleep (4) msg Hi
then /easy-sign-reorder 3 1
will change the actions to be:
(1) sleep (2) sound ENTITY_IRON_GOLEM_DEATH 1.00 1.00 (3) heal 2 (4) msg Hi
Formatting Codes
The msg
and announce
actions support Minecraft formatting codes beginning with the ampersand, &
.
Two &
characters in succession adds a single ampersand to the message.
The /signtext
command shows a guide to colour codes in chat.
Minecraft's formatting codes are documented in the Minecraft Wiki Formatting Codes article.
Source Code
The source code and technical information are available at https://github.com/NerdNu/EasySigns.