Setting up SFTP on Legitimoose.com

SFTP allows you to edit your Legitimoose.com datapack from a copy of VSCode (or another IDE) running on your local machine.

This involves a bit more setup than using our browser-based code editor, but allows for greater customization, saving settings between sessions, and even using 3rd party datapack tools like MCBuild, Beet, and others.

1. Install VS Code

This guide assumes you have VS Code installed and set up for datapack development already. If you don't, now is the time to do that!

Download VSCode and install the Datapack Helper Plus extension.

2. SFTP Extension

VS Code's native support for SFTP is not great, so for this guide we'll be using SFTP by Natizyskunk. Install this, then we can start configuring it.

3. Setup

  1. In VS Code, create an empty directory to download the datapack folder to.
  2. Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac open command palette, run SFTP: config command.
  3. A file will appear named sftp.json under the .vscode directory, open and edit the configuration parameters with your remote server information.
  4. In Minecraft, run /sftp. Click the link in chat to copy sftp.json, and paste it into your file.

    Here's an example of what that should look like:

    [
        {
            "name": "Datapack",
            "host": "sftp.legitimoose.com",
            "protocol": "sftp",
            "port": 8022,
            "username": "a4da5cfd9ead4b858cd19f55ef9f9bcf",
            "remotePath": "/datapacks/",
            "context": "./datapacks",
            "uploadOnSave": true,
            "watcher": {
                "files": "**/*",
                "autoUpload": true,
                "autoDelete": true
            },
            "syncOption": {
                "delete": true,
                "update": true
            }
        },
        {
            "name": "Moose Support Files (Download once)",
            "host": "sftp.legitimoose.com",
            "protocol": "sftp",
            "port": 8022,
            "username": "a4da5cfd9ead4b858cd19f55ef9f9bcf",
            "remotePath": "/support"
        }
    ]
    
    • The username field is your world's UUID without the dashes.
    • The password is the same as your editor password.
  5. Save and close the sftp.json file.
  6. Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac open command palette.
  7. Type sftp and you'll now see a number of other commands. You can also access many of the commands from the project's file explorer context menus.
  8. A good one to start with is SFTP: Download Project. This will download the directory shown in the remotePath setting in sftp.json to your open directory.

You can now edit your files, and after each save it will sync with the remote copy!
Remember, you can get the password with /sftp or /editor! It will change each time the world starts.

4. Support Files

In the JSON, you may have seen that it is configured to download some additional files besides your datapack, from a folder called support. This folder will contain commands.json and spyglass.json. These are config files for Datapack Helper Plus that allow it to provide code completion for custom commands from the Legitimoose server, such as /http, /playerlist, and /visibility.

Once they are downloaded, restart VS Code for the highlighting to take effect!

5. Done!

You can now edit your datapack from the comfort of your own editor! If you have any questions, feel free to ask in our Discord, or the Minecraft server itself!