### Permission Management Examples (LuckPerms) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Illustrates how to manage Dynamic Difficulty permissions using a plugin like LuckPerms. Covers granting all permissions, self-only commands, and permissions to affect other players. ```bash # Grant all DynamicDifficulty permissions /lp user PlayerName permission set affinity.* # Grant only self-commands (can only affect own affinity) /lp user PlayerName permission set affinity.*.self # Grant ability to modify other players /lp user PlayerName permission set affinity.*.other ``` -------------------------------- ### Affinity Management API Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Endpoints for managing individual player affinity settings, including getting, setting, adding, removing, and modifying minimum/maximum affinity values. ```APIDOC ## Affinity Management Endpoints ### Get Affinity **Description**: Retrieves the current affinity value for a player. **Method**: GET **Endpoint**: `/affinity/get` **Query Parameters**: - **player** (string) - Required - The name of the player whose affinity to retrieve. ### Set Affinity **Description**: Sets a specific affinity value for a player. **Method**: POST **Endpoint**: `/affinity/set` **Query Parameters**: - **player** (string) - Required - The name of the player whose affinity to set. - **value** (integer) - Required - The new affinity value. ### Add Affinity **Description**: Adds a value to the player's current affinity. **Method**: POST **Endpoint**: `/affinity/add` **Query Parameters**: - **player** (string) - Required - The name of the player. - **value** (integer) - Required - The value to add to the affinity. ### Remove Affinity **Description**: Subtracts a value from the player's current affinity. **Method**: POST **Endpoint**: `/affinity/remove` **Query Parameters**: - **player** (string) - Required - The name of the player. - **value** (integer) - Required - The value to remove from the affinity. ### Set Minimum Affinity **Description**: Sets the minimum allowed affinity value for a player. **Method**: POST **Endpoint**: `/affinity/setmin` **Query Parameters**: - **player** (string) - Required - The name of the player. - **value** (integer) - Required - The minimum affinity value. ### Set Maximum Affinity **Description**: Sets the maximum allowed affinity value for a player. **Method**: POST **Endpoint**: `/affinity/setmax` **Query Parameters**: - **player** (string) - Required - The name of the player. - **value** (integer) - Required - The maximum affinity value. ### Delete Minimum Affinity **Description**: Removes the minimum affinity constraint for a player. **Method**: DELETE **Endpoint**: `/affinity/delmin` **Query Parameters**: - **player** (string) - Required - The name of the player. ### Delete Maximum Affinity **Description**: Removes the maximum affinity constraint for a player. **Method**: DELETE **Endpoint**: `/affinity/delmax` **Query Parameters**: - **player** (string) - Required - The name of the player. ### Reload Affinity **Description**: Reloads affinity data, potentially from configuration files or external sources. **Method**: POST **Endpoint**: `/affinity/reload` ### Force Save Affinity **Description**: Forces the current affinity data to be saved. **Method**: POST **Endpoint**: `/affinity/forcesave` ### Player GUI **Description**: Opens the player affinity graphical user interface. **Method**: POST **Endpoint**: `/affinity/playergui` **Query Parameters**: - **player** (string) - Required - The name of the player to open the GUI for. ### Get Difficulties **Description**: Retrieves information about the configured difficulty levels. **Method**: GET **Endpoint**: `/affinity/difficulties` ### Get Own Affinity **Description**: Retrieves the affinity value for the player making the request. **Method**: GET **Endpoint**: `/affinity/me` ### Author Info **Description**: Retrieves information about the plugin author. **Method**: GET **Endpoint**: `/affinity/author` ### Force Removal **Description**: Forces the removal of a player's affinity data. **Method**: DELETE **Endpoint**: `/affinity/forceremoval` **Query Parameters**: - **player** (string) - Required - The name of the player to remove affinity for. ### Help **Description**: Displays help information for the affinity commands. **Method**: GET **Endpoint**: `/affinity/help` ``` -------------------------------- ### Manage Player Affinity with Bash Commands Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt These bash commands interact with the DynamicDifficulty plugin to manage player affinity points. They allow getting, setting, adding, removing, and setting limits for player affinity, as well as applying changes to multiple players and accessing GUI interfaces. Supports selectors like @a, @p, @r, and @s. ```bash # Get a player's current affinity, difficulty level, and limits /affinity get PlayerName # Output: PlayerName has 750 affinity points # Currently on [Normal] difficulty # Max affinity: 1500 # Set a player's affinity to a specific value /affinity set PlayerName 600 # Add affinity points to a player /affinity add PlayerName 100 # Remove affinity points from a player /affinity remove PlayerName 50 # Set minimum affinity limit for a player (prevents going below this value) /affinity setmin PlayerName 200 # Set maximum affinity limit for a player (prevents going above this value) /affinity setmax PlayerName 1000 # Remove min/max limits /affinity delmin PlayerName /affinity delmax PlayerName # Apply to all players using @a selector /affinity set @a 600 /affinity add @a 50 # Open GUI interfaces /affinity me # View your own difficulty settings /affinity playergui # Open player management GUI /affinity difficulties # View all configured difficulties # Admin commands /affinity reload # Reload configuration /affinity forcesave # Force save player data to storage /affinity forceremoval # Disable plugin and reset all player health ``` -------------------------------- ### Configure DynamicDifficulty Plugin Settings (YAML) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt The config.yml file for DynamicDifficulty allows customization of affinity gain/loss values, difficulty levels, and plugin behavior. It includes settings for passive affinity gain, points awarded/deducted for various actions (mining, combat, death), rate limiting, starting values, server-wide limits, custom mob/block affinity values, and toggleable features like difficulty calculation modes and advanced mob enhancements. ```yaml # Affinity gain/loss settings version: 1.9 points-per-minute: 2 # Passive affinity gain for online players block-mined: 1 # Default affinity for mining blocks player-hit: -1 # Affinity lost when hit affinity-per-heart-loss: -1 # Affinity lost per heart of damage taken pve-kill: 2 # Default affinity for killing mobs death: -100 # Affinity lost on death # Rate limiting to prevent exploits max-affinity-gain-per-minute: 0 # 0 = unlimited max-affinity-loss-per-minute: 0 # Starting values for new players starting-affinity: 600 starting-min-affinity: -1 # -1 = no limit starting-max-affinity: -1 # Server-wide limits min-affinity: 0 max-affinity: 1500 # Custom affinity per mob type mobs-count-as-pve: - ZOMBIE # Uses default pve-kill value (2) - CREEPER: 3 # Custom value - ENDER_DRAGON: 100 - WARDEN: 200 # Custom affinity per block type blocks: - DIAMOND_ORE # Uses default block-mined value (1) - ANCIENT_DEBRIS: 4 # Custom value - EMERALD_ORE # Toggle settings toggle-settings: update-time-ticks: 1200 # How often to recalculate (20 ticks = 1 second) difficulty-type: player # Options: player, region, world, biome, time silk-touch-allowed: false prevent-affinity-loss-on-suicide: true loot-changes-to-spawned-mobs: false allow-tamed-wolves-in-calculations: true force-hard-difficulty: true advanced: custom-enchants-on-mobs: true armor-on-mobs: true exact-percentage: true # Smooth transitions between difficulties ``` -------------------------------- ### Database Configuration Options (YAML) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Configures persistent storage for player affinity data. Supports various database types including file, MySQL, SQLite, PostgreSQL, and MariaDB, as well as disabling persistence entirely. ```yaml saving-data: type: file # Options: none, file, mysql, sqlite, postgresql, mariadb ``` ```yaml # For database storage (mysql, postgresql, mariadb): saving-data: type: mysql port: 3306 host: localhost username: minecraft password: secretpassword database: dynamicdifficulty ``` ```yaml # For SQLite (single file database): saving-data: type: sqlite # Data stored in plugins/DynamicDifficulty/database.db ``` ```yaml # For no persistence (resets on restart): saving-data: type: none ``` -------------------------------- ### Custom Mob Equipment Configuration (YAML) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Defines custom equipment (weapons and armor) that mobs can spawn with at different difficulty levels. Allows for weighted item pools and enchantment configurations. ```yaml custom-mob-items-spawn-chance: override-default-limits: false # Allow enchant levels above vanilla max override-enchant-conflicts: false # Allow conflicting enchants # Which mobs receive custom equipment includes-mobs: - ZOMBIE - SKELETON # Weapon pool with weighted chances weapons-include: - WOODEN_SWORD: 200 # Common - GOLDEN_SWORD: 50 # Uncommon - IRON_SWORD: 5 # Rare - WOODEN_AXE: 200 - IRON_AXE: 5 # Armor material weights (higher = more common) armor-set-weight: leather: 3706 golden: 4872 chainmail: 1290 iron: 127 diamond: 4 netherite: 1 # Enchantment pools per armor slot helmet-enchants-include: - protection: 10 # Weight 10 - blast_protection: 5 - fire_protection: 5 - aqua_affinity: 2 - thorns # Weight 1 (default) - respiration: 2 - unbreaking: 5 weapon-enchants-include: - sharpness: 10 - fire_aspect: 2 - looting: 2 - knockback: 2 - smite: 5 - bane_of_arthropods: 5 ``` -------------------------------- ### Region-Based Difficulty Configuration (YAML) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Configures difficulty based on a player's distance from a specified center point. Players further away face harder challenges. Supports circular and square regions, with customizable radii per world. ```yaml toggle-settings: difficulty-type: region difficulty-type: region: type: "circle" # Options: circle, square default-radius: 5000.0 # Default radius for worlds not listed reversed: false # If true, center is hardest x: 0.0 # Center X coordinate z: 0.0 # Center Z coordinate radius: # Affinity calculation: (MaxAffinity / Radius) * Distance # At 200 blocks from spawn in overworld: (1500 / 5000) * 200 = 60 affinity world: 5000.0 world_nether: 625.0 # Nether is denser, smaller radius world_the_end: 1250.0 ``` -------------------------------- ### Time-Based Difficulty Configuration (YAML) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Configures difficulty that dynamically changes based on the in-game time. This allows for making certain times of day, like night, more dangerous. Supports world-specific time scales. ```yaml toggle-settings: difficulty-type: time difficulty-type: time: ignore-nether: false ignore-the-end: true default: 0.4 # Default multiplier for unlisted worlds world-scales: # Time 0-24000 (0 = dawn, 6000 = noon, 12000 = dusk, 18000 = midnight) # Affinity = MaxAffinity * Multiplier world: 2000: 0.0 # Early morning: 0 affinity (Easy) 14000: 0.5 # Evening: 750 affinity (Normal) 18000: 1.0 # Midnight: 1500 affinity (Hard) world_nether: 2000: 0.0 14000: 0.5 18000: 1.0 ``` -------------------------------- ### Affinity Scope Endpoints Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Endpoints that combine affinity operations with scope modifiers like 'self' or 'other'. ```APIDOC ## Affinity Scope Endpoints ### Get Own Affinity (Scoped) **Description**: Retrieves the affinity value specifically for the player making the request, emphasizing the 'self' scope. **Method**: GET **Endpoint**: `/affinity/get/self` ### Set Other Player's Affinity **Description**: Allows setting the affinity for another player, indicating the 'other' scope. **Method**: POST **Endpoint**: `/affinity/set/other` **Query Parameters**: - **target_player** (string) - Required - The name of the player whose affinity is being set. - **value** (integer) - Required - The new affinity value. - **admin_player** (string) - Optional - The name of the administrator performing the action. ``` -------------------------------- ### World and Mob Exclusion Configuration (YAML) Source: https://context7.com/jeannotm/dynamicdifficulty/llms.txt Defines specific worlds or mobs where Dynamic Difficulty modifications should be disabled. This allows for exceptions to the general difficulty settings. ```yaml # World configuration worlds: type: exclude # Options: include, exclude list: - creative_world # DD disabled in this world - minigames_lobby - build_world ``` ```yaml # Alternative: whitelist mode worlds: type: include list: - survival_world # DD only active in these worlds - hardcore_world ``` ```yaml # Mobs that ignore all DD modifications # These mobs won't have damage changes, won't give affinity, etc. disabled-mobs: - ENDER_DRAGON # Boss fights remain vanilla - ENDER_CRYSTAL - ELDER_GUARDIAN - WARDEN - WITHER ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.