### Setting up Python Virtual Environment (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md These commands install the `virtualenv` package globally or for the user, create a new virtual environment named `env` in the current directory, and then activate it. Activating the environment isolates installed Python packages for this project. ```sh $ pip install --user virtualenv $ virtualenv env $ source env/bin/activate ``` -------------------------------- ### Installing Python Dependencies (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md This command uses `pip`, the Python package installer, to read the list of required packages from `requirements.txt` and install them into the currently active Python environment. This is necessary to run Mkdocs and other potential scripts. ```sh pip install -r requirements.txt ``` -------------------------------- ### Previewing Mkdocs Documentation (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md This command starts a local web server using Mkdocs, hosting the documentation. It automatically rebuilds and refreshes the browser when changes are detected in the source files, allowing for live previewing of documentation edits. ```sh $ mkdocs serve ``` -------------------------------- ### Applying Patches Gradle Bash Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Runs the Gradle task to apply patches to the Purpur source code. This is the initial setup step after cloning the repository to prepare the source for building. ```bash ./gradlew applyPatches ``` -------------------------------- ### Example Compare Commits Output (Two Hashes) (yml) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md An example of the YAML output generated by the `compare-commits.sh` script when comparing two explicit commit hashes. It details added and removed configuration options and permissions within the specified commit range. ```yml # logs/885092..22b876.yml config: additions: - gameplay-mechanics.item.immune.cactus: new ArrayList<>() - gameplay-mechanics.player.fix-stuck-in-portal: 'false' removals: - projectile-load-save-per-chunk-limit: '-1' permission: additions: [] removals: [] ``` -------------------------------- ### Example Compare Commits Output (One Hash) (yml) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md An example of the YAML output generated by the `compare-commits.sh` script when comparing a single hash against the latest commit on the default branch. It shows the structure for reporting additions and removals of config/permissions. ```yml # logs/885092..ver|1.16.5.yml config: additions: - gameplay-mechanics.item.immune.cactus: new ArrayList<>() - gameplay-mechanics.player.fix-stuck-in-portal: 'false' removals: - projectile-load-save-per-chunk-limit: '-1' permission: additions: [] removals: [] ``` -------------------------------- ### Running Test Server with PurpurExtras using Gradle (Shell) Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpurextras/index.md This command utilizes the Gradle wrapper (./gradlew) to execute the 'runServer' task. This task is typically configured to download and run a server instance (likely Purpur) with the compiled PurpurExtras plugin already in the plugins directory, allowing for quick testing. It requires a Gradle setup that supports running servers. ```Shell ./gradlew runServer ``` -------------------------------- ### Example Compare Commits Output (--no-commits, First Run) (yml) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md An example of the YAML output generated by the `compare-commits.sh` script when run with the `-nc` flag for the first time. This output typically represents the comparison between the initial `last_commit` value (often based on the current latest) and the same or a similar reference point. ```yml # logs/885092..ver|1.16.5.yml config: additions: - gameplay-mechanics.item.immune.cactus: new ArrayList<>() - gameplay-mechanics.player.fix-stuck-in-portal: 'false' removals: - projectile-load-save-per-chunk-limit: '-1' permission: additions: [] removals: [] ``` -------------------------------- ### Building PurpurExtras Plugin with Gradle (Shell) Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpurextras/index.md This command uses the Gradle wrapper (./gradlew) to execute the 'shadowJar' task, which compiles the project and packages it into a single executable JAR file, typically found in the build/libs directory. It requires a local Gradle installation (or the wrapper) and the project source code. ```Shell ./gradlew shadowJar ``` -------------------------------- ### Publishing Purpur Artifacts Maven Local Gradle Bash Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Executes the Gradle 'publishToMavenLocal' task to install the compiled 'purpur-api' and 'purpur' dependencies into your local Maven repository. This allows other local projects to depend on these artifacts directly. ```bash ./gradlew publishToMavenLocal ``` -------------------------------- ### Example Compare Commits Output (--no-commits, Subsequent Run) (yml) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md An example of the YAML output generated by the `compare-commits.sh` script when run with the `-nc` flag on a subsequent execution. It shows the changes between the commit hash stored in `last_commit` from the previous run and the current latest commit. ```yml # logs/885092..22b876.yml config: additions: - gameplay-mechanics.item.immune.cactus: new ArrayList<>() - gameplay-mechanics.player.fix-stuck-in-portal: 'false' removals: - projectile-load-save-per-chunk-limit: '-1' permission: additions: [] removals: [] ``` -------------------------------- ### Example last_commit File Content (After First Run) (yml) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md Shows the content of the `last_commit` file created after the first execution of the `compare-commits.sh` script with the `--no-commits` flag. This file stores the commit hash that will be used as the previous commit for the *next* run. ```yml # Creates a last_commit file 885092 ``` -------------------------------- ### Example last_commit File Content (After Subsequent Run) (yml) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md Shows the updated content of the `last_commit` file after a subsequent execution of the `compare-commits.sh` script with the `--no-commits` flag. This file now contains the latest commit hash from the most recent run. ```yml # Modifies the last_commit file 22b876 ``` -------------------------------- ### Skeleton Bow Accuracy Calculation Examples YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md These YAML examples illustrate how the skeleton's bow accuracy formula `14 - difficulty * 4` translates to different divergence (spread) values depending on the game difficulty setting. A higher divergence value indicates less accurate shots. ```YAML easy: 14 - 1 * 4 = 10 normal: 14 - 2 * 4 = 6 hard: 14 - 3 * 4 = 2 ``` -------------------------------- ### Configuring Blast Resistance Overrides - Purpur - YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This snippet demonstrates how to modify the blast resistance of specified blocks using the `blast-resistance-overrides` configuration option. It shows examples for 'minecraft:oak_leaves' and 'minecraft:obsidian' with custom resistance values. This requires the Purpur server software. ```yaml blast-resistance-overrides: minecraft:oak_leaves: 55 minecraft:obsidian: 1.5 ``` -------------------------------- ### Listing Ignored Grindstone Enchantments - Purpur - YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This snippet shows how to configure the `ignored-enchants` list for grindstones. Enchantments listed here will not be removed when an item is processed by a grindstone. The example includes 'minecraft:binding_curse' and 'minecraft:vanishing_curse'. This requires the Purpur server software. ```yaml - minecraft:binding_curse - minecraft:vanishing_curse ``` -------------------------------- ### Building Purpurclip Jar Gradle Bash Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Executes the Gradle 'paperclip' task to build the Purpurclip jar. This is the executable server jar that combines the server code with dependencies. ```bash ./gradlew paperclip ``` -------------------------------- ### Building Purpur Jars Gradle Bash Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Executes the Gradle 'build' task to compile the Purpur API and Server jars. The resulting jars will be placed in the build/libs directories of Purpur-API and Purpur-Server. ```bash ./gradlew build ``` -------------------------------- ### Adding Purpur API Dependency Maven Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Adds the Purpur API dependency to your project's POM file. This allows your project to compile against the Purpur API, which includes Paper, Spigot, and Bukkit APIs. The scope is 'provided' as the server provides the API at runtime. ```xml org.purpurmc.purpur purpur-api {{ project.version }}-R0.1-SNAPSHOT provided ``` -------------------------------- ### Running Compare Commits Script with --no-commits (First Run) (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md Executes the `compare-commits.sh` script using the `--no-commits` or `-nc` flag for the first time. The script will capture the current latest commit, use it as the 'previous' hash for the next run, and compare an internal default range (often the same commit as the current latest to itself, or against a built-in reference) primarily to initialize the `last_commit` file. ```sh # First time running it $ ./compare-commits.sh -nc ``` -------------------------------- ### Configuring Silk Touch Spawner Tools Whitelist (YAML) Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML list serves as a whitelist for tools that can successfully mine spawners when enchanted with Silk Touch. Only tools specified in this list will work for the `silk-touch.tools` option. ```yaml - minecraft:iron_pickaxe - minecraft:golden_pickaxe - minecraft:diamond_pickaxe - minecraft:netherite_pickaxe ``` -------------------------------- ### Configuring Silk Touch Spawner Lore (YAML) Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML list defines the lore text lines that will be applied to spawners mined using the Silk Touch feature. The placeholder `` will be replaced with the actual type of mob the spawner contains. ```yaml - Spawns a ``` -------------------------------- ### Adding Purpur Repository Gradle Groovy Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Adds the Purpur Maven repository to your build.gradle file for projects using Groovy DSL. This repository is needed to download Purpur dependencies. ```groovy repositories { //... other repos ...// //Add this somewhere after mavenCentral() maven { url "https://repo.purpurmc.org/snapshots" } //... other repos ...// } ``` -------------------------------- ### Rebuilding Patches Gradle Bash Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Runs the Gradle task to rebuild patch files from commits in the Purpur-API or Purpur-Server repositories. Used after modifying code or adding commits to create or update corresponding patch files. ```bash ./gradlew rebuildPatches ``` -------------------------------- ### Adding Purpur API Dependency Gradle Kotlin Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Adds the Purpur API dependency to your build.gradle.kts file using the Kotlin DSL. Uses 'compileOnly' scope as the API is provided by the Purpur server at runtime. ```kotlin dependencies { //... other dependencies ...// compileOnly("org.purpurmc.purpur", "purpur-api", "{{ project.version }}-R0.1-SNAPSHOT") //... other dependencies ...// } ``` -------------------------------- ### Adding Purpur Repository Gradle Kotlin Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Adds the Purpur Maven repository to your build.gradle.kts file for projects using Kotlin DSL. This makes Purpur artifacts available for dependency resolution. ```kotlin repositories { //... other repos ...// //Add this somewhere after mavenCentral() maven("https://repo.purpurmc.org/snapshots") //... other repos ...// } ``` -------------------------------- ### Running Compare Commits Script with --no-commits (Subsequent Run) (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md Executes the `compare-commits.sh` script using the `--no-commits` or `-nc` flag after the `last_commit` file already exists. The script reads the previous hash from this file, compares it to the *current* latest commit, and updates the `last_commit` file with the new latest hash. ```sh # Running it again after new commits are pushed to Purpur $ ./compare-commits.sh -nc ``` -------------------------------- ### Running Compare Commits Script with Two Hashes (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md Executes the `compare-commits.sh` script, passing two Git commit hashes as arguments. This tells the script to compare changes between the specified `` and `` and output the results to a YAML file. ```sh $ ./compare-commits.sh 885092 22b876 ``` -------------------------------- ### Configuring Food Properties YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML snippet demonstrates how to customize properties for a specific food item (spider_eye). It shows settings for nutritional value, saturation modifier, meat status, eating speed, and a list of effects to apply upon consumption, including effect duration, chance, visibility, amplifier, ambient particles, and icon display. ```YAML spider_eye: # The food to edit nutrition: 2 # The amount of hunger points restored saturation-modifier: 0.8 # The amount of saturation restored. Equation used is "nutrition * saturation-modifier * 2" is-meat: false # Marks a food as edible for wolfs can-always-eat: false # Marks if this food can be eaten even at full hunger fast-food: false # How long it takes to eat food (false: 32 ticks, true: 16 ticks) effects: # List of all the effects to be applied when eaten (can have multiple effects) poison: # Effect to apply duration: 100 # Duration of effect (in ticks) chance: 1.0 # Chance for effect to be applied (0.0 - 1.0) visible: true # Shows particles amplifier: 1 # Amplification of effect ambient: false # Set to true to make particles less obtrusive on screen (like beacon effects) show-icon: true # Show effect icon on HUD ``` -------------------------------- ### Configuring Shovel Grass Path Blocks (YAML) Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML list specifies the block IDs that will be converted into a grass path block when a player right-clicks them with a shovel. It defines the valid source blocks for the `shovel-turns-block-to-grass-path` feature. ```yaml - minecraft:coarse_dirt - minecraft:dirt - minecraft:grass_block - minecraft:mycelium - minecraft:podzol - minecraft:rooted_dirt ``` -------------------------------- ### Running Compare Commits Script with One Hash (sh) Source: https://github.com/purpurmc/purpurdocs/blob/main/README.md Executes the `compare-commits.sh` script, passing only one Git commit hash. The script will compare the specified `` against the latest commit on the configured branch (e.g., `ver/1.16.5`) and output the changes. ```sh $ ./compare-commits.sh 885092 ``` -------------------------------- ### Applying Log4j Configuration File Purpur 1.16.5- Shell Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/log4j.md This command-line argument is added to the Java launch command for Purpur server versions 1.16.5 and older (down to 1.14.1). It specifies a custom Log4j configuration XML file ('purpur_log4j2_1141-1165.xml') provided by Purpur that contains mitigations for the Log4j vulnerability. ```Shell -Dlog4j.configurationFile=purpur_log4j2_1141-1165.xml ``` -------------------------------- ### Adding Purpur API Dependency Gradle Groovy Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Adds the Purpur API dependency to your build.gradle file using the Groovy DSL. The 'compileOnly' scope indicates that the dependency is required for compilation but provided at runtime by the server. ```groovy dependencies { //... other dependencies ...// compileOnly "org.purpurmc.purpur:purpur-api:{{ project.version }}-R0.1-SNAPSHOT" //... other dependencies .../// } ``` -------------------------------- ### Configuring Explosion Immune Items - YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML snippet demonstrates how to configure which items are immune to explosions within the Purpur server configuration. It shows a list format under the `explosion` key, where each item is specified by its Minecraft identifier. This configuration is part of the `item.immune` settings. ```yaml explosion: - minecraft:diamond - minecraft:diamond_block - minecraft:diamond_sword ``` -------------------------------- ### Adding Purpur Repository Maven Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/index.md Adds the Purpur Maven repository to your project's POM file. This is required to resolve Purpur artifacts when building your project with Maven. ```xml purpur Purpur Maven Repo https://repo.purpurmc.org/snapshots ``` -------------------------------- ### Applying Log4j Configuration File Purpur 1.18-1.17 Shell Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/log4j.md This command-line argument is added to the Java launch command for Purpur server versions 1.18 to 1.17. It specifies a custom Log4j configuration XML file ('purpur_log4j2_117.xml') provided by Purpur that contains mitigations for the Log4j vulnerability. ```Shell -Dlog4j.configurationFile=purpur_log4j2_117.xml ``` -------------------------------- ### Defining Ravager Griefable Blocks - YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML snippet specifies a list of block types that the Ravager mob is allowed to destroy. It acts as a whitelist for controlling the mob griefing behavior of Ravagers. ```yaml - minecraft:oak_leaves - minecraft:spruce_leaves - minecraft:birch_leaves - minecraft:jungle_leaves - minecraft:acacia_leaves - minecraft:dark_oak_leaves - minecraft:beetroots - minecraft:carrots - minecraft:potatoes - minecraft:wheat ``` -------------------------------- ### Calculating Snow Golem Shoot Interval Formula Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This formula, presented in shell (`sh`) syntax, determines the delay in ticks between a snow golem's projectile shots. It considers the distance to the target, attack range, a snowball modifier, and the configured minimum and maximum shoot intervals. Setting both `min-shoot-interval-ticks` and `max-shoot-interval-ticks` to 0 disables shooting. ```sh ((sqrt(distanceToTarget) / attack-distance) / snow-ball-modifier) * (max-shoot-interval-ticks - min-shoot-interval-ticks) + min-shoot-interval-ticks ``` -------------------------------- ### Configure Controllable Minecart Block Speeds - YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML snippet defines custom speed modifiers for controllable minecarts based on the block they are currently on. It requires the minecart.controllable.enabled option to be true. The keys are block identifiers and the values are the desired speed multiplier for that block. ```YAML grass_block: 0.3 stone: 0.5 ``` -------------------------------- ### Disabling Commands in Essentials YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/commands.md This YAML configuration snippet demonstrates how to add specific commands to the `disabled_commands` section within the Essentials plugin's configuration file. This prevents Essentials from overriding Purpur's implementations of these commands, allowing the server to use the Purpur versions instead. ```yaml disabled-commands: - ping - uptime - compass ``` -------------------------------- ### Default Conduit Valid Ring Blocks - YAML Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This YAML snippet shows the default list of block types that are considered valid for constructing the frame around a conduit to enable its power effect. These blocks are typically variations of Prismarine. ```YAML - minecraft:prismarine - minecraft:prismarine_bricks - minecraft:sea_lantern - minecraft:dark_prismarine ``` -------------------------------- ### Calculating Shulker Spawn Chance Formula Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/configuration.md This formula is used to calculate the chance of a shulker spawning from a bullet based on the number of nearby shulkers. The variable `nearby` represents the count of shulker entities within the specified range. ```Formula (nearby - 1) / 5.0 ``` -------------------------------- ### Testing Log4j Vulnerability Text Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/log4j.md This string can be sent in the server chat to test if a Minecraft server is vulnerable to the Log4j exploit. A vulnerable server will attempt a JNDI lookup via LDAP upon processing this string, which can be observed in the server console logs. ```Text ${jndi:ldap://127.0.0.1:1389/a} ``` -------------------------------- ### Setting Log4j Format Message No Lookups Shell Source: https://github.com/purpurmc/purpurdocs/blob/main/mkdocs/purpur/log4j.md This command-line argument sets the Java system property `log4j2.formatMsgNoLookups` to true. While this property disables message lookups in Log4j2 versions 2.10.0+, effectively mitigating the vulnerability on those versions (like Minecraft 1.17+), it is ineffective on older Log4j versions used in versions 1.16.5 and older. ```Shell -Dlog4j2.formatMsgNoLookups=true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.