From c4d697fcf4180aed01e341a47d44f9affca97990 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Fri, 9 May 2025 10:29:56 -0400 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=8E=A8=20Add=20newline=20to=20summon?= =?UTF-8?q?=20command=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[...4]rigs/[...2]summoning-a-new-rig-instance/+page.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/docs/[...4]rigs/[...2]summoning-a-new-rig-instance/+page.md b/src/routes/docs/[...4]rigs/[...2]summoning-a-new-rig-instance/+page.md index 994851b..fc1a361 100644 --- a/src/routes/docs/[...4]rigs/[...2]summoning-a-new-rig-instance/+page.md +++ b/src/routes/docs/[...4]rigs/[...2]summoning-a-new-rig-instance/+page.md @@ -14,7 +14,8 @@ function animated_java:/summon {args: {}} However, you may want to specify the position and rotation of the Rig Instance. To do this, you can change the execution context of the `summon` function: ```rust title=Summoning a Rig Instance at a specific position and rotation | copy -execute positioned rotated run function animated_java:/summon {args: {}} +execute positioned rotated run \ + function animated_java:/summon {args: {}} ``` ## Arguments From bfbee4ae014d6938a8662c92c3463bd9a7e12b6c Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Fri, 9 May 2025 10:30:25 -0400 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=9A=9A=20Moved=20Animation=20playback?= =?UTF-8?q?=20functions=20to=20their=20own=20page.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[...3]controlling-a-rig-instance/+page.md | 86 ----------------- .../+page.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 86 deletions(-) create mode 100644 src/routes/docs/[...4]rigs/[...4]controlling-animation-playback/+page.md diff --git a/src/routes/docs/[...4]rigs/[...3]controlling-a-rig-instance/+page.md b/src/routes/docs/[...4]rigs/[...3]controlling-a-rig-instance/+page.md index 1e2d51a..c26723e 100644 --- a/src/routes/docs/[...4]rigs/[...3]controlling-a-rig-instance/+page.md +++ b/src/routes/docs/[...4]rigs/[...3]controlling-a-rig-instance/+page.md @@ -38,92 +38,6 @@ execute as @e[type=item_display,tag=aj..root] at @s run \ tp @s ~ ~5 ~ ~90 ~ ``` -## Controlling Animation Playback - -Animation playback is controlled using functions. Each animation has a set of functions that can be called to control it. Animation functions _must_ be ran as the root entity of the Rig Instance. - -### Play Function - -Starts playing the animation from the beginning. - -```rust title=Play the walk animation | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/play -``` - -### Pause Function - -Pauses the animation at the current frame. - -```rust title=Pause the walk animation | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/pause -``` - -### Resume Function - -Resumes the animation from the current frame. - -```rust title=Resume the walk animation | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/resume -``` - -### Stop Function - -Stops the animation and resets it to the beginning. - -```rust title=Stop the walk animation | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/stop -``` - -### Apply Frame Function - -Sets the animation to a specific frame with interpolation. - -#### Arguments - -| Name | Type | Description | -| ------- | ------- | ---------------------------------- | -| `frame` | Integer | The frame to set the animation to. | - -```rust title=Set the walk animation to frame 10 with interpolation | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/apply_frame {frame: 10} -``` - -### Set Frame Function - -Sets the animation to a specific frame instantly without interpolation. - -#### Arguments - -| Name | Type | Description | -| ------- | ------- | ---------------------------------- | -| `frame` | Integer | The frame to set the animation to. | - -```rust title=Set the walk animation to frame 10 | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/set_frame {frame: 10} -``` - -#### Tween Function - -Pauses all currently playing animations, and smoothly transitions to the target frame of this animation over the duration, then resumes the animation from the target frame. - -#### Arguments - -| Name | Type | Description | -| ---------- | ------- | ---------------------------------------- | -| `to_frame` | Integer | The frame of this animation to tween to. | -| `duration` | Integer | The duration of the tween in ticks. | - -```rust title=Smoothly transition the walk animation to frame 10 over a second | copy -execute as @e[type=item_display,tag=aj..root] run \ - function animated_java:/animations/walk/tween {to_frame: 10, duration: 20} -``` - ## Applying Variants Variants can be applied to the Rig Instance using the desired Variant's `apply` function. diff --git a/src/routes/docs/[...4]rigs/[...4]controlling-animation-playback/+page.md b/src/routes/docs/[...4]rigs/[...4]controlling-animation-playback/+page.md new file mode 100644 index 0000000..146895d --- /dev/null +++ b/src/routes/docs/[...4]rigs/[...4]controlling-animation-playback/+page.md @@ -0,0 +1,92 @@ +--- +title: Controlling Animation Playback +description: Learn how to control the playback of Animations. +--- + +# { $frontmatter.title } + +{ $frontmatter.description } + +Animation playback is controlled using functions. Each animation has a set of functions that can be called to control it. Animation functions _must_ be ran [as the root entity](/docs/rigs/controlling-a-rig-instance#selecting-the-rig-instance) of the Rig Instance. + +### Play Function + +Starts playing the animation from the beginning. + +```rust title=Play the walk animation | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//play +``` + +### Pause Function + +Pauses the animation at the current frame. + +```rust title=Pause the walk animation | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//pause +``` + +### Resume Function + +Resumes the animation from the current frame. + +```rust title=Resume the walk animation | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//resume +``` + +### Stop Function + +Stops the animation and resets it to the beginning. + +```rust title=Stop the walk animation | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//stop +``` + +### Apply Frame Function + +Sets the animation to a specific frame with interpolation. + +#### Arguments + +| Name | Type | Description | +| ------- | ------- | ---------------------------------- | +| `frame` | Integer | The frame to set the animation to. | + +```rust title=Set the walk animation to frame 10 with interpolation | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//apply_frame {frame: 10} +``` + +### Set Frame Function + +Sets the animation to a specific frame instantly without interpolation. + +#### Arguments + +| Name | Type | Description | +| ------- | ------- | ---------------------------------- | +| `frame` | Integer | The frame to set the animation to. | + +```rust title=Set the walk animation to frame 10 | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//set_frame {frame: 10} +``` + +#### Tween Function + +Pauses all currently playing animations, and smoothly transitions to the target frame of this animation over the duration, then resumes the animation from the target frame. + +#### Arguments + +| Name | Type | Description | +| ---------- | ------- | ---------------------------------------- | +| `to_frame` | Integer | The frame of this animation to tween to. | +| `duration` | Integer | The duration of the tween in ticks. | + +```rust title=Smoothly transition the walk animation to frame 10 over a second | copy +execute as @e[type=item_display,tag=aj..root] run \ + function animated_java:/animations//tween {to_frame: 10, duration: 20} +``` From e06d4a292dea5b6989d37dfb8a8fbb73dd5e3d15 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Fri, 9 May 2025 10:31:03 -0400 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=A8Updated=20locator=20and=20camer?= =?UTF-8?q?a=20pages=20to=20v1.7.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/[...4]rigs/[...4]locators/+page.md | 82 ------------- .../docs/[...4]rigs/[...5]cameras/+page.md | 31 ----- .../docs/[...4]rigs/[...5]locators/+page.md | 110 ++++++++++++++++++ .../docs/[...4]rigs/[...6]cameras/+page.md | 31 +++++ .../{[...6]tags => [...7]tags}/+page.md | 0 5 files changed, 141 insertions(+), 113 deletions(-) delete mode 100644 src/routes/docs/[...4]rigs/[...4]locators/+page.md delete mode 100644 src/routes/docs/[...4]rigs/[...5]cameras/+page.md create mode 100644 src/routes/docs/[...4]rigs/[...5]locators/+page.md create mode 100644 src/routes/docs/[...4]rigs/[...6]cameras/+page.md rename src/routes/docs/[...4]rigs/{[...6]tags => [...7]tags}/+page.md (100%) diff --git a/src/routes/docs/[...4]rigs/[...4]locators/+page.md b/src/routes/docs/[...4]rigs/[...4]locators/+page.md deleted file mode 100644 index 0a21a58..0000000 --- a/src/routes/docs/[...4]rigs/[...4]locators/+page.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: Interacting with Locators -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. ---- - -# { $frontmatter.title } - -{ $frontmatter.description } - -## Excuting Commands using Locator Offset Data - -You can execute commands at a specific locator's position / rotation using the data entity's `data.locators.` NBT. - -:::admonition type=info title=Example -Execute at a specific locator's position - -```py title=foo/as_root.mcfunction | copy -execute \ - # Get the root entity context - as @e[tag=aj.global.root] at @s \ - # Execute the command on the root entity's passengers - on passengers \ - # Filter out the data entity from the passengers - if entity @s[tag=aj.global.data] \ -run \ - # Run our position function with the Locator's position data - function foo:position with entity @s data.locators. -``` - -Then, using the locator's position data, we can now execute commands at that position with macros: - -```rust title=foo/position.mcfunction | copy -$execute positioned ^$(posx) ^$(posy) ^$(posz) rotated ~$(roty) ~$(rotx) run ... -``` - -:::admonition type=note -You should _always_ replace the example `@e[tag=aj.global.root]` selector with a more specific selector. -::: - -:::admonition type=info title=Example -Execute as a specific locator's entity - -Note that this method will only work if you have the Locator's `Use Entity` config option enabled. - -```py title=foo/as_root.mcfunction | copy -execute \ - # Get the root entity context - as @e[tag=aj.global.root] at @s \ - # Execute the command on the root entity's passengers - on passengers \ - # Filter out the data entity from the passengers - if entity @s[tag=aj.global.data] \ -run \ - # Run our select function with the Locator's UUID - function foo:select with entity @s data.locators. -``` - -Then, using the locator's UUID, we can now execute commands as that entity with macros: - -```rust title=foo/select.mcfunction | copy -$execute as $(uuid) run ... -``` - -::: - -## Executing Commands as Locator Entities - -You can use the `as_own_locator_entities` function to execute commands as all of a Rig Instance's locator entities. - -:::admonition type=info title=Example - -```rust title=foo/as_root.mcfunction | copy -execute as @e[tag=aj.global.root] run \ - function animated_java:/as_own_locator_entities \ - {command:'function foo:as_locator'} -``` - -```rust title=foo/as_locator.mcfunction | copy -say Hello, World! -``` - -::: diff --git a/src/routes/docs/[...4]rigs/[...5]cameras/+page.md b/src/routes/docs/[...4]rigs/[...5]cameras/+page.md deleted file mode 100644 index 7def5f6..0000000 --- a/src/routes/docs/[...4]rigs/[...5]cameras/+page.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Interacting with Cameras -description: Cameras are specialized Locators optimized to orient a player's screen, and can be used to create cutscenes, custom player perspectives, and more. This page explains how to interact with Cameras in your Rig Instance using commands. ---- - -# { $frontmatter.title } - -{ $frontmatter.description } - -## Force the Player to Spectate a Camera - -:::admonition type=info title=Example - -```py title="foo/as_root.mcfunction" -execute \ - # Get the root entity context - as @e[tag=aj.global.root] \ - # Execute the command on the root's passengers - on passengers \ - # Filter out the data entity from the passengers - if entity @s[tag=aj.global.data] \ -run \ - # Run our select function with the Camera's UUID - function foo:select with entity @s data.cameras. -``` - -```py title="foo/select.mcfunction" -$execute as $(uuid) run spectate @s @p -``` - -::: diff --git a/src/routes/docs/[...4]rigs/[...5]locators/+page.md b/src/routes/docs/[...4]rigs/[...5]locators/+page.md new file mode 100644 index 0000000..0eb1a64 --- /dev/null +++ b/src/routes/docs/[...4]rigs/[...5]locators/+page.md @@ -0,0 +1,110 @@ +--- +title: Interacting with Locators +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. +--- + +# { $frontmatter.title } + +{ $frontmatter.description } + +## Single Locator Functions + +- ### As Locator - `animated_java:/as_locator` + + Runs a command as **_and at_** a specific locator's entity. + + #### Arguments + + | Name | Type | Description | + | --------- | ------ | ---------------------------------------------- | + | `name` | String | The name of the locator to run the command as. | + | `command` | String | The command to run as the locator. | + + :::admonition type="info" title="Example" + + ```rust title=Running a command as a locator | copy + execute as @e[tag=aj..root] run \ + function animated_java:/as_locator \ + {name: '', command:'say Hello, World!'} + ``` + + ::: + + :::admonition type=note title=Note + 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. + ::: + +- ### At Locator - `animated_java:/at_locator` + + Runs a command at a specific locator's position / rotation. + + #### Arguments + + | Name | Type | Description | + | --------- | ------ | ---------------------------------------------- | + | `name` | String | The name of the locator to run the command at. | + | `command` | String | The command to run at the locator's position. | + + :::admonition type="info" title="Example" + + ```rust title=Running a command at a locator | copy + execute as @e[tag=aj..root] run \ + function animated_java:/at_locator \ + {name: '', command:'particle minecraft:angry_villager ~ ~ ~'} + ``` + + ::: + + :::admonition type=note title=Note + The `at_locator` function **_does not_** require the Locator's [Use Entity](/docs/the-blueprint-format/locators#use-entity) config option to be enabled. + ::: + +## Multi Locator Functions + +- ### As All Locators - `animated_java:/as_all_locators` + + Runs a command as **_and at_** all locators in the Rig Instance. + + #### Arguments + + | Name | Type | Description | + | --------- | ------ | ----------------------------------- | + | `command` | String | The command to run as all locators. | + + :::admonition type="info" title="Example" + + ```rust title=Running a command as all locators | copy + execute as @e[tag=aj..root] run \ + function animated_java:/as_all_locators \ + {command:'say Hello, World!'} + ``` + + ::: + + :::admonition type=note title=Note + 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. + ::: + +- ### At All Locators - `animated_java:/at_all_locators` + + Runs a command at all locators in the Rig Instance. + + :::admonition type="info" title="Example" + + #### Arguments + + | Name | Type | Description | + | --------- | ------ | ----------------------------------- | + | `command` | String | The command to run at all locators. | + + ```rust title=Running a command at all locators | copy + execute as @e[tag=aj..root] run \ + function animated_java:/at_all_locators \ + {command:'particle minecraft:angry_villager ~ ~ ~'} + ``` + + ::: + + :::admonition type=note title=Note + The `at_all_locators` function **_does not_** require the Locators' [Use Entity](/docs/the-blueprint-format/locators#use-entity) config option to be enabled. + ::: diff --git a/src/routes/docs/[...4]rigs/[...6]cameras/+page.md b/src/routes/docs/[...4]rigs/[...6]cameras/+page.md new file mode 100644 index 0000000..5610f18 --- /dev/null +++ b/src/routes/docs/[...4]rigs/[...6]cameras/+page.md @@ -0,0 +1,31 @@ +--- +title: Interacting with Cameras +description: Cameras are specialized Locators optimized to orient a player's screen, and can be used to create cutscenes, custom player perspectives, and more. This page explains how to interact with Cameras in your Rig Instance using commands. +--- + +# { $frontmatter.title } + +{ $frontmatter.description } + +## Force the Player to Spectate a Camera + +### As Camera - `animated_java:/as_camera` + +Runs a command as **_and at_** a specific camera's entity. + +#### Arguments + +| Name | Type | Description | +| --------- | ------ | --------------------------------------------- | +| `name` | String | The name of the camera to run the command as. | +| `command` | String | The command to run as the camera. | + +:::admonition type="info" title="Example" + +```rust title=Running a command as a camera | copy +execute as @e[tag=aj..root] run \ + function animated_java:/as_camera \ + {name: '', command:'say Hello, World!'} +``` + +::: diff --git a/src/routes/docs/[...4]rigs/[...6]tags/+page.md b/src/routes/docs/[...4]rigs/[...7]tags/+page.md similarity index 100% rename from src/routes/docs/[...4]rigs/[...6]tags/+page.md rename to src/routes/docs/[...4]rigs/[...7]tags/+page.md From 18a939ed2c29fb967ee5bfd13f7e2bccd50ead56 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Fri, 9 May 2025 10:31:30 -0400 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=91=B7=20Add=20`--frozen-lockfile`=20?= =?UTF-8?q?argument=20to=20build.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 986b3e2..b1b9d80 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: run: corepack enable - name: Install Dependencies - run: yarn install + run: yarn install --frozen-lockfile - name: Build run: yarn build