๐ stewbeet.plugins.copy_to_destination
๐ Source Code: stewbeet/plugins/copy_to_destination/__init__.py ๐
๐ Dependencies
- โ Required: Generated pack archives from archive plugin
- โ Required: Configured destination paths in project metadata
- ๐ Position: Should run after archive and merge_smithed_weld plugins
- ๐ง Optional: Custom libraries in libs folder
- ๐ง Optional: Official libraries (copies only used ones)
- ๐ Related: Works with output from archive and merge plugins
๐ Overview
The copy_to_destination plugin automatically copies generated packs to configured destinations.
It handles copying datapacks, resource packs, library dependencies, and official libraries
to multiple destination folders with intelligent merge detection, retry logic for permission
handling, and proper directory structure management for development and testing workflows.
Some Features Showcase
Datapack and all dependencies are copied to destination

๐ฏ Purpose
- ๐ Copies generated packs to configured destination folders
- ๐ Handles both individual datapacks and merged resource packs
- ๐ Automatically copies library dependencies and official libraries
- ๐ Provides retry logic for handling permission errors
- ๐ฏ Supports multiple destinations for different environments (local and remote)
- ๐ Supports SFTP remote destinations with optional credentials file
- ๐ ๏ธ Facilitates development workflows with automatic deployment
โ๏ธ Configuration
๐ฏ Basic Example Configuration
pipeline: - ... - stewbeet.plugins.copy_to_destination meta: stewbeet: build_copy_destinations: datapack: - "path/to/minecraft/saves/world/datapacks" - "path/to/development/datapacks" - "sftp://user@host/remote/path/datapacks" resource_pack: - "path/to/minecraft/resourcepacks" - "path/to/server/resourcepacks" - "sftp://user@host/remote/path/resourcepacks" libs_folder: "libs" # Optional: custom libraries folder
๐ Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
build_copy_destinations | object | {} | Configuration for copy destinations |
build_copy_destinations.datapack | array | [] | List of datapack destination paths (local or sftp://) |
build_copy_destinations.resource_pack | array | [] | List of resource pack destination paths (local or sftp://) |
libs_folder | string | "libs" | Folder containing custom library archives |
| Retry Logic | automatic | 10 attempts | Maximum retry attempts for permission errors (local only) |
๐ SFTP Credentials
SFTP destinations use the URL format sftp://user@host/remote/path.
The password is resolved in this order:
- Inline in the URL โ
sftp://user:password@host/remote/path(not recommended for version-controlled files) - Credentials file โ
~/stewbeet/credentials.yml(recommended)
~/stewbeet/credentials.yml structure
sftp: user@host: # must match the user@host part of the SFTP URL exactly password: "your_password"
โ ๏ธ If the remote directory does not exist, the copy is skipped with a warning. The plugin will not create remote directories.
โจ Features
๐ฆ Datapack Distribution System
Copies main datapacks and library dependencies to configured destinations:
- ๐ Copies main project datapack to all configured destinations
- ๐ Automatically includes all library datapacks from libs folder
- ๐ Scans for
.zipfiles in the libraries datapack directory - โ Creates destination directories if they don't exist
๐จ Resource Pack Management
Handles resource pack copying with merge detection:
- ๐ Prioritizes merged resource packs over individual ones
- ๐ฆ Falls back to normal resource pack if merged version unavailable
- ๐ท๏ธ Preserves appropriate naming for merged vs normal packs
- ๐ Maintains proper file organization in destination folders
๐๏ธ Official Library Distribution
Copies used official libraries to datapack destinations:
- ๐ Only copies libraries marked as used in the project
- ๐ Validates library existence before copying
- ๐ Organizes libraries in appropriate destination folders
- โ Provides informative logging for each copied library
๐ Retry Logic System
Implements robust file copying with error handling:
- ๐ก๏ธ Handles permission errors with automatic retry logic
- โฐ Uses configurable delay between retry attempts
- ๐งน Attempts to remove existing files before copying
- โ ๏ธ Provides warnings during retry attempts with clear messaging
๐ SFTP Remote Destinations
Copies files to remote servers over SFTP:
- ๐ Accepts
sftp://user@host/pathURLs alongside local paths - ๐ Resolves passwords from inline URL or
~/stewbeet/credentials.yml - โ ๏ธ Skips copy with a warning if the remote directory does not exist
- ๐ซ No retry logic for SFTP (handled by the underlying
fsspeclibrary)
๐ Smart Copy Detection
Intelligently determines which files to copy based on availability:
- ๐ Checks for pack existence before attempting copies
- ๐ Skips operations when no destinations are configured
- ๐ฏ Validates project configuration requirements
- โ Provides early exit for efficiency when no work is needed