Xhaelan's Turtles

Link turtles together to create large-scale automation projects with ease.

11

Quick challenge

How far can you run before the mobs catch you?

Xhaelan's Turtles

Xhaelan's Turtles

You shall move turtles (referring to turtle graphics) around with the use of functions and playlists.

* Access all functionality through `/function xhaelan:turtles/...` * Use playlists to automate path creation and run other commands * Change blocks, positions and edit playlists mid-run * Move turtles with: * `xhaelan:turtles/controls/forward` * `xhaelan:turtles/controls/backward` * `xhaelan:turtles/controls/teleport`

Accessing Functionality

* Turtles are accessible through the `/function` command, with the following categories (the last of which is for advanced users): * `controls` * `paint` - functions under here must be ran as `/function <function> with storage xhaelan:turtles <id>` * `manage` * `playlists` * Each turtle is fully independent and identified by its ID. Create a turtle with `/function xhaelan:turtles/manage/create {id: <id>}`. Note that these IDs are not namespaced (e.g. use `my_turtle` instead of `mypack:my_turtle`).

Using Playlists

* Playlists store commands in a list per turtle. They can be run with `/function xhaelan:turtles/playlists/play {id: <id>}`. They can be loaded with many `movement` and `command`s as well as `jumping` and `resetting` the turtle's position. Commands may be removed if desired. * Here are all of the playlist functions (mode refers to the method for inserting the command into the playlist): * `/function xhaelan:turtles/playlists/add_command {command: '<command>', mode: [append|prepend], id: <id>}` * `/function xhaelan:turtles/playlists/add_movement {direction: [forward|backward], mode: [append|prepend], id: <id>}` * `/function xhaelan:turtles/playlists/add_teleport {x: <x>, y: <y>, z: <z>, mode: [append|prepend], id: <id>}` * `/function xhaelan:turtles/playlists/end {report_completion: [1b|0b], id: <id>}` * `/function xhaelan:turtles/playlists/play {id: <id>}` * `/function xhaelan:turtles/playlists/remove_command {index: <index>, id: <id>}`

Changing Blocks and Positions

* Blocks can be changed with `/function xhaelan:turtles/manage/set_block {id: <id>, block: "<block_id>"}` * Turtle positions can be changed with `/function xhaelan:turtles/manage/set_xyz {x: <x>, y: <y>, z: <z>, id: <id>}`. For painting, this represents the first vertex of the `cuboid`. * Second-selection positions can be changed with `/function xhaelan:turtles/manage/set_next_xyz {x: <x>, y: <y>, z: <z>, id: <id>}`. As expected, this is the other vertex of the `cuboid`.

Moving Turtles

* This is the most important but least noticeable part of turtles. Use either of these functions to move the turtle backward or forward in the specified axis: * `/function xhaelan:turtles/controls/forward {axis: <axis>, id: <id>}` * `/function xhaelan:turtles/controls/backward {axis: <axis>, id: <id>}` * `/function xhaelan:turtles/controls/teleport {x: <x>, y: <y>, z: <z>, id: <id>}` * The `teleport` function does not draw anything, even when `pen_down` is set to `1b`.

Turtle Management

* Other than creating turtles, there are a few other functions that can modify turtles: * `/function xhaelan:turtles/manage/remove {id: <id>}` - removes the turtle scoreboards and storage data * `/function xhaelan:turtles/manage/reset {id: <id>}` - completely refreshes all data and scoreboards of the turtle while keeping the ID * `/function xhaelan:turtles/manage/set_block {block: "<block_id>", id: <id>}` - does not set a block at the turtles position like the `/setblock` command. Instead, it changes the block it is currently using * [`set_xyz` and `set_next_xyz` from earlier]

Videos

* For version 1.0: https://youtu.be/aFknzl9HlTU

Optimisations!

* Unlike some turtle implementations, this pack does not use entities * It avoids tick-based functions entirely * These optimisations make the pack suitable for large-scale turtle projects, which is the purpose of this data pack.

ADS