|
| 1 | +--- |
| 2 | +title: Interacting with Locators |
| 3 | +description: Locators are points in space that can be used to execute commands at specific positions / rotations relative to your Rig Instance. This page explains how to interact with Locators in your Rig Instance using commands. |
| 4 | +--- |
| 5 | + |
| 6 | +# { $frontmatter.title } |
| 7 | + |
| 8 | +{ $frontmatter.description } |
| 9 | + |
| 10 | +## Single Locator Functions |
| 11 | + |
| 12 | +- ### As Locator - `animated_java:<export_namespace>/as_locator` |
| 13 | + |
| 14 | + Runs a command as **_and at_** a specific locator's entity. |
| 15 | + |
| 16 | + #### Arguments |
| 17 | + |
| 18 | + | Name | Type | Description | |
| 19 | + | --------- | ------ | ---------------------------------------------- | |
| 20 | + | `name` | String | The name of the locator to run the command as. | |
| 21 | + | `command` | String | The command to run as the locator. | |
| 22 | + |
| 23 | + :::admonition type="info" title="Example" |
| 24 | + |
| 25 | + ```rust title=Running a command as a locator | copy |
| 26 | + execute as @e[tag=aj.<export_namespace>.root] run \ |
| 27 | + function animated_java:<export_namespace>/as_locator \ |
| 28 | + {name: '<locator_name>', command:'say Hello, World!'} |
| 29 | + ``` |
| 30 | +
|
| 31 | + ::: |
| 32 | +
|
| 33 | + :::admonition type=note title=Note |
| 34 | + The `as_locator` function will only work if you have the Locator's [Use Entity](/docs/the-blueprint-format/locators#use-entity) config option enabled. |
| 35 | + ::: |
| 36 | + |
| 37 | +- ### At Locator - `animated_java:<export_namespace>/at_locator` |
| 38 | + |
| 39 | + Runs a command at a specific locator's position / rotation. |
| 40 | + |
| 41 | + #### Arguments |
| 42 | + |
| 43 | + | Name | Type | Description | |
| 44 | + | --------- | ------ | ---------------------------------------------- | |
| 45 | + | `name` | String | The name of the locator to run the command at. | |
| 46 | + | `command` | String | The command to run at the locator's position. | |
| 47 | + |
| 48 | + :::admonition type="info" title="Example" |
| 49 | + |
| 50 | + ```rust title=Running a command at a locator | copy |
| 51 | + execute as @e[tag=aj.<export_namespace>.root] run \ |
| 52 | + function animated_java:<export_namespace>/at_locator \ |
| 53 | + {name: '<locator_name>', command:'particle minecraft:angry_villager ~ ~ ~'} |
| 54 | + ``` |
| 55 | +
|
| 56 | + ::: |
| 57 | +
|
| 58 | + :::admonition type=note title=Note |
| 59 | + The `at_locator` function **_does not_** require the Locator's [Use Entity](/docs/the-blueprint-format/locators#use-entity) config option to be enabled. |
| 60 | + ::: |
| 61 | + |
| 62 | +## Multi Locator Functions |
| 63 | + |
| 64 | +- ### As All Locators - `animated_java:<export_namespace>/as_all_locators` |
| 65 | + |
| 66 | + Runs a command as **_and at_** all locators in the Rig Instance. |
| 67 | + |
| 68 | + #### Arguments |
| 69 | + |
| 70 | + | Name | Type | Description | |
| 71 | + | --------- | ------ | ----------------------------------- | |
| 72 | + | `command` | String | The command to run as all locators. | |
| 73 | + |
| 74 | + :::admonition type="info" title="Example" |
| 75 | + |
| 76 | + ```rust title=Running a command as all locators | copy |
| 77 | + execute as @e[tag=aj.<export_namespace>.root] run \ |
| 78 | + function animated_java:<export_namespace>/as_all_locators \ |
| 79 | + {command:'say Hello, World!'} |
| 80 | + ``` |
| 81 | +
|
| 82 | + ::: |
| 83 | +
|
| 84 | + :::admonition type=note title=Note |
| 85 | + The `as_all_locators` function will only work if all Locators have the [Use Entity](/docs/the-blueprint-format/locators#use-entity) config option enabled. |
| 86 | + ::: |
| 87 | +
|
| 88 | +- ### At All Locators - `animated_java:<export_namespace>/at_all_locators` |
| 89 | +
|
| 90 | + Runs a command at all locators in the Rig Instance. |
| 91 | +
|
| 92 | + :::admonition type="info" title="Example" |
| 93 | +
|
| 94 | + #### Arguments |
| 95 | +
|
| 96 | + | Name | Type | Description | |
| 97 | + | --------- | ------ | ----------------------------------- | |
| 98 | + | `command` | String | The command to run at all locators. | |
| 99 | +
|
| 100 | + ```rust title=Running a command at all locators | copy |
| 101 | + execute as @e[tag=aj.<export_namespace>.root] run \ |
| 102 | + function animated_java:<export_namespace>/at_all_locators \ |
| 103 | + {command:'particle minecraft:angry_villager ~ ~ ~'} |
| 104 | + ``` |
| 105 | +
|
| 106 | + ::: |
| 107 | +
|
| 108 | + :::admonition type=note title=Note |
| 109 | + The `at_all_locators` function **_does not_** require the Locators' [Use Entity](/docs/the-blueprint-format/locators#use-entity) config option to be enabled. |
| 110 | + ::: |
0 commit comments