Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document new actions & update descriptions #194

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/blocks/structures.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Structures are a very powerful feature that can be used to implement an endless
| `trigger` | <span className="badge badge--secondary" title="Can be either this attribute or a sub-element.">Property</span><span className="badge badge--danger">Required</span>Dynamic filter which triggers placement and clearing of structures. | [Dynamic Filter](/docs/modules/mechanics/filters#dynamic-filters) |
| `location` | The location to place the structure at. The structure's `origin` will be at this point.<br />*Mutually exclusive with `offset`.* | <span className="badge badge--primary">X,Y,Z</span> |
| `offset` | Relative position to place the structure at. The structure will be translated by this amount from its original location.<br />*Mutually exclusive with `location`.* | <span className="badge badge--primary">X,Y,Z</span> | `0,0,0` *(structure placed at its original location)* |
| `update` | Placed blocks will update upon interaction, e.g., redstone, and invalid block placements such as floating ladders, "popping" off. *May impact performance for large fills.* | <span className="badge badge--primary">true/false</span> | true |

### Examples

Expand Down
45 changes: 40 additions & 5 deletions docs/modules/mechanics/actions-triggers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ In the future, some features that are currently used in Kits may be transferred
|---|---|
| `<action> </action>` | A group of actions running in a sequence. |
| `<switch-scope> </switch-scope>` | Changes the scope that an action applies to. |
| `<repeat> </repeat>` | Loop actions without recursions. |
| `<message/>` | A message that is sent to the player. |
| `<sound/>` | A sound that is played for the player. |
| `<set/>` | Sets a new value for a [Variable](/docs/modules/mechanics/variables). |
Expand All @@ -25,6 +26,7 @@ In the future, some features that are currently used in Kits may be transferred
| `<fill/>` | Places blocks in a block-bounded region. |
| `<paste-structure/>` | Places a structure at a specified location when triggered. |
| `<replace-item> </replace-item>` | Finds and replaces certain items. |
| `<enchant-item> </enchant-item>` | Enchants the targeted item. |
| `<take-payment> </take-payment>` | Allow players to pay with items in their inventory to trigger an action. |
| `<velocity/>` | A player-scoped kit that applies velocity to the player. |
| `<teleport/>` | Teleport a player to a specific location. |
Expand All @@ -46,6 +48,13 @@ In the future, some features that are currently used in Kits may be transferred
| `inner` | Specify the scope of the inner action. | `player`, `team`, or `match` |
| `outer` | Specify the scope outside of an action.<br />*In some cases, this can be omitted as PGM will automatically infer the outer scope.* | `player`, `team`, or `match` |

### Repeat Attributes

| Attribute | Description | Value |
|---|---|---|
| `times` | The amount of time to repeat.<br />*Non-whole numbers will be rounded down. Negative numbers will cause no iterations.* | <span className="badge badge--primary">Expression</span> |
| `filter` | Filters when this loop should be active. This will be checked as many time as the loop is ran. | [Filter](/docs/modules/mechanics/filters) |

### Message Attributes

| Attribute | Description | Value | Default |
Expand All @@ -62,20 +71,36 @@ In the future, some features that are currently used in Kits may be transferred

| Element | Description | Value |
|---|---|---|
| `<replacements>` | A list of replacements.<br />**Note:** In the future, more replacements such as player names will be supported. | <span className="badge badge--secondary">Replacements Sub-elements</span> |
| `<replacements>` | A list of replacements.<br />**Note:** In the future, more replacements will be supported. | <span className="badge badge--secondary">Replacements Sub-elements</span> |

| Sub-element | Description |
|---|---|
| `<decimal/>` | A numerical placeholder. |
| `<player/>` | A player's name placeholder. |

##### Decimal Attributes

| Attribute | Description | Value |
|---|---|---|
| `id` | Unique identifier used to reference this decimal from other places in the XML. | <span className="badge badge--primary">String</span> |
| `id` | Unique identifier used to reference this decimal placeholder from other places in the XML. | <span className="badge badge--primary">String</span> |
| `value` | <span className="badge badge--danger">Required</span>The variable this decimal should evaluate. It can be used with formulas. | <span className="badge badge--primary">Expression</span> |
| `format` | Customize how the decimal should be displayed, e.g. `#.00`. | [Java DecimalFormat pattern](https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html) |

##### Player Attributes

| Attribute | Description | Value | Default |
|---|---|---|---|
| `id` | <span className="badge badge--danger">Required</span>Unique identifier used to reference this player placeholder from other places in the XML. | <span className="badge badge--primary">String</span> |
| `var` | <span className="badge badge--danger">Required</span>The exclusive player-scoped variable to check for. | [Variable](/docs/modules/mechanics/variables) |
| `style` | The style to display the player's name in. | `plain`, `color`,<br />`fancy`, `verbose` | `verbose` |
| `fallback` | If no player has been assigned this variable, set the text to display instead. | <span className="badge badge--primary">String</span> |

###### Style Examples

| Description | Screenshot
|---|---|
| `plain` - no formatting at all.<br />`simple_color` **(discouraged)** - team color formatting without click-to-teleport hover.<br />`color` - the player's name with team color with click-to-teleport hover.<br />`fancy` - contains fancy formatting, flairs, colors, click-to-teleport hover, and special formatting from Community or third-party plugins.<br />`tab` **(discouraged)** - formatted as a tablist entry with team color, flairs, death status, self, etc.<br />`verbose` - like `fancy`, but includes full nickname of nicked users to server operators. | ![Unnicked player placeholder in chat](/img/player-replacement-action-chat-unnicked.png 'Unnicked player placeholder in chat')<br />![Server operator perspective of the player placeholder in chat](/img/player-replacement-action-chat-op.png 'Server operator perspective of the player placeholder in chat') |

### Sound Attributes

| Attribute | Description | Value | Default |
Expand Down Expand Up @@ -107,17 +132,19 @@ In the future, some features that are currently used in Kits may be transferred
| `material` | <span className="badge badge--danger">Required</span>The filling material. | [Single Material Pattern](/docs/reference/items/inventory#material-matchers) |
| `filter` | Filters which blocks get affected. *May impact performance for large fills.* | [Filter](/docs/modules/mechanics/filters) |
| `events` | Calls events for block placements and removals, which will make it affected by other filters and PGM features. *May impact performance for large fills.* | <span className="badge badge--primary">true/false</span> | false |
| `update` | Placed blocks will update upon interaction, e.g., redstone, and invalid block placements such as floating ladders, "popping" off. *May impact performance for large fills.* | <span className="badge badge--primary">true/false</span> | true |

### Paste-Structure Attributes

| Attribute | Description | Value |
|---|---|---|
| Attribute | Description | Value | Default |
|---|---|---|---|
| `x` | The X coordinate of the location to paste the structure, measured in east-west. | <span className="badge badge--primary">Expression</span> |
| `y` | The Y coordinate of the location to paste the structure, measured in altitude. | <span className="badge badge--primary">Expression</span> |
| `z` | The Z coordinate of the location to paste the structure, measured in north-south. | <span className="badge badge--primary">Expression</span> |
| `structure` | The structure to paste. | [Structure ID](/docs/modules/blocks/structures) |
| `update` | Placed blocks will update upon interaction, e.g., redstone, and invalid block placements such as floating ladders, "popping" off. *May impact performance for large fills.* | <span className="badge badge--primary">true/false</span> | true |

### Replace Item
### Replace-Item

#### Sub-elements

Expand All @@ -135,6 +162,14 @@ In the future, some features that are currently used in Kits may be transferred
| `ignore-metadata` | Filters which entities to remove. | <span className="badge badge--primary">true/false</span> |
| `amount` | Match for item stacks that have a certain amount of items in a range. | <span className="badge badge--primary">Range</span> |

### Enchant-Item Attributes

| Attribute | Description | Value |
|---|---|--|
| `enchantment` | An item enchantment. | [Enchantment Name](/docs/reference/items/enchantments) |
| `level` | The specified enchantment's level. | <span className="badge badge--primary">Expression</span> |
| `ignore-metadata` | Filters which entities to remove. | <span className="badge badge--primary">true/false</span> |

### Take-Payment

#### Sub-elements
Expand Down
5 changes: 3 additions & 2 deletions docs/modules/objectives/monument-modes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ Each `<mode>` has configurable characteristics that define it.
| Attribute | Description | Value | Default |
|---|---|---|---|
| `id` | Unique identifier used to reference this mode from other places in the XML. | <span className="badge badge--primary">String</span> |
| `name` | The custom mode display name, used for the mode change notification. | <span className="badge badge--primary">Formatted Text</span> |
| `name` | The custom mode display name, used for the mode change notification.<br />**Note:** This is required if `material` is not set. | <span className="badge badge--primary">Formatted Text</span> |
| `filter` | Filter that triggers mode countdown. | [Dynamic Filter](/docs/modules/mechanics/filters#dynamic-filters) |
| `material` | <span className="badge badge--danger">Required</span>The material the core/destroyable will change to. | [Single Material Pattern](/docs/reference/items/inventory#material-matchers) |
| `action` | Trigger a specificed action when this mode is activated.<br />**Note:** This is required if `material` is not set. | [Action ID](/docs/modules/mechanics/actions-triggers)
| `material` | The material the core/destroyable will change to. | [Single Material Pattern](/docs/reference/items/inventory#material-matchers) |
| `after` | <span className="badge badge--danger">Required</span>The time from the start of the match until this mode takes effect. If a filter is defined, then it will be the time since the filter passes `ALLOW`. | [Time Period](/docs/reference/misc/time-periods) |
| `show-before` | The time before a mode is transitioning to show it in the boss bar. If `show-before` is set to 0, the mode is not shown in the boss bar at all. | [Time Period](/docs/reference/misc/time-periods) | 1m |

Expand Down
Binary file added static/img/player-replacement-action-chat-op.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.