Skip to content

Commit 30f60db

Browse files
committed
✨ Locator Docs Improvements
1 parent 6c4a7b0 commit 30f60db

File tree

3 files changed

+66
-4
lines changed
  • src/routes/docs/[...4]the-blueprint-format/[...6]locators
  • static/img/steps/locator

3 files changed

+66
-4
lines changed

src/routes/docs/[...4]the-blueprint-format/[...6]locators/+page.md

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ description: Locators are used to execute commands at a specific position / rota
77

88
{ $frontmatter.description }
99

10+
## Creating a Locator
11+
12+
To create a locator, locate the `Add Locator` button above the outliner.
13+
14+
![add-locator-action](/img/steps/locator/1.png)
15+
16+
If this button isn't there, you can press `h` and then search for `Add Locator`.
17+
1018
## Config Options
1119

1220
- ### Use Entity
@@ -31,13 +39,64 @@ description: Locators are used to execute commands at a specific position / rota
3139

3240
If `Use Entity` is enabled, the commands will be executed as the locator's entity.
3341

34-
## Excuting Commands as / at Locators
42+
## Animating Locators
43+
44+
### Position / Rotation
45+
46+
Locators must be a child of a Bone in order to be positioned / rotated.
47+
48+
### Command Keyframes
49+
50+
When selecting a Locator in `Animate Mode`, you can add Command Keyframes to it's Timeline to play commands at specific times during an animation.
51+
52+
![locator-keyframes](/img/steps/locator/2.png)
53+
54+
#### Command Keyframe Options
55+
56+
- #### Command
57+
58+
The command(s) that will be executed. Supports multiple commands (one per line) similar to a `mcfunction`, and supports [MC-Build](https://mcbuild.dev/) syntax.
59+
60+
- #### Repeat?
61+
62+
If enabled, the command will be executed every `Repeat Frequency` ticks until the next keyframe.
63+
64+
- #### Repeat Frequency
65+
66+
The amount of ticks between each repeated command execution. A value of `1` will execute the command every tick.
67+
68+
`Repeat Frequency` is relative to the animation, and will pause / play with the animation.
69+
70+
If your animation's length is not evenly divisible by the `Repeat Frequency`, the time between the last command execution and the end of the animation will be less than the `Repeat Frequency`.
71+
72+
- #### Execute Condition
73+
74+
A condition that must be met in order for the command to be executed.
75+
76+
Expects a chain of [execute sub-commands](https://minecraft.wiki/w/Commands/execute#Syntax) without `execute` or `run`.
77+
78+
:::admonition type=info title=Example
79+
80+
```txt title="A Simple Execute Condition"
81+
if entity @s[tag=my_tag]
82+
```
83+
84+
```txt title="A More Complex Execute Condition"
85+
aligned xyz positioned ~.5 ~ ~.5 if entity @n[tag=my_tag,distance=..0.1]
86+
```
87+
88+
:::
89+
90+
## Excuting Commands as / at Locators Externally.
91+
92+
Sometimes you may want to execute commands at a specific locator's position / rotation from an external function. This can be done by getting the locator's information using the data entity's `data.locators.<locator_name>` NBT.
3593

3694
:::admonition type=info title=Example
3795
Execute at a specific locator's position
3896

3997
```txt title="foo/as_root.mcfunction"
40-
execute as <root> on passengers if entity @s[tag=aj.data] run function foo:position with entity @s data.locators.<locator_name>
98+
execute as <root> on passengers if entity @s[tag=aj.data] run \
99+
function foo:position with entity @s data.locators.<locator_name>
41100
```
42101

43102
```txt title="foo/position.mcfunction"
@@ -52,7 +111,8 @@ Execute as a specific locator's entity
52111
Note that this method will only work if you have the Locator's `Use Entity` config option enabled.
53112

54113
```txt title="foo/as_root.mcfunction"
55-
execute as <root> on passengers if entity @s[tag=aj.data] run function foo:select with entity @s data.locators.<locator_name>
114+
execute as <root> on passengers if entity @s[tag=aj.data] run \
115+
function foo:select with entity @s data.locators.<locator_name>
56116
```
57117

58118
```txt title="foo/select.mcfunction"
@@ -66,7 +126,9 @@ $execute as $(uuid) run ...
66126
Executing commands at all of a Rig Instance's locators that have an entity associated with them.
67127

68128
```txt title="foo/as_root.mcfunction"
69-
execute as <root> run function animated_java:<export_namespace>/as_own_locator_entities {command:'function foo:as_locator'}
129+
execute as <root> run \
130+
function animated_java:<export_namespace>/as_own_locator_entities \
131+
{command:'function foo:as_locator'}
70132
```
71133

72134
```txt title="foo/as_locator.mcfunction"

static/img/steps/locator/1.png

51.3 KB
Loading

static/img/steps/locator/2.png

159 KB
Loading

0 commit comments

Comments
 (0)