PlayerViewDistanceController (PVDC)

website·Indexed 31 days ago

https://docs.wyzebb.dev

A plugin for PaperMC and its forks that manages player view distance. It features dynamic and ping modes, AFK checks, and integrations with GeyserMC, LuckPerms, and PlaceholderAPI.

Tokens
5.2K
Snippets
26
Records
44
Agent score
57%

What's inside PVDC

  1. Overview of Player View Distance Controller (PVDC) features

    Player View Distance Controller (PVDC) is a Paper plugin designed to optimize server performance by controlling player view distances. Key capabilities include:

    • Granular Control: Set and persist max view distances for individual players or globally for all online players.
    • Dynamic Performance Scaling:
      • MSPT-based mode: Automatically reduces view distance as Milliseconds Per Tick (MSPT) increases to stabilize server performance.
      • Ping-based adjustments: Reduces view distance for high-ping players to improve their client-side experience.
    • Resource Optimization:
      • AFK Restriction: Limits view distance for AFK players to reduce unnecessary chunk loading and ticking.
      • Simulation Impact: Entities, blocks, and fluids outside the view distance are not ticked, reducing CPU load.
    • Integrations & Compatibility:
      • LuckPerms: Supports permission-based view distance limits for groups or individuals.
      • GeyserMC: Full support for Bedrock players, including custom default view distance values.
      • PlaceholderAPI: Includes an internal expansion for providing view-distance related placeholders.
    • Customization: Supports multi-language configurations for all plugin messages.
    • Management: Most commands are executable via the server console.
  2. Use Ping Mode to optimize view distance based on player latency

    Ping mode in PVDC allows the server to automatically lower a player's view distance if their ping exceeds specific thresholds. Instead of setting the view distance to a fixed value, Ping Mode reduces the view distance by a specified number of chunks from the player's current maximum allowed distance. This ensures that existing view distance permissions and other mode settings are respected.

    Key behaviors:

    • Can be enabled or disabled on a per-player basis.
    • Compatible with Dynamic Mode; when both are active, Ping Mode uses the maximum distance determined by Dynamic Mode.
    • View distance is checked and updated every specified tick interval.
  3. Use GeyserMC integration to customize Bedrock players

    PVDC integrates with GeyserMC to detect when players are using Bedrock clients. This integration allows server administrators to apply bedrock-specific settings and modify the bedrock name prefix for those players.
  4. Integrate PVDC with LuckPerms for permission-based view distance

    PVDC can hook into LuckPerms to manage view distance via permission nodes. While optional, this integration is recommended to extend functionality. For offline players, PVDC uses their maximum view distance (VD) excluding context-specific nodes. PVDC automatically detects LuckPerms node changes and recalculates the view distance for affected players when a pvdc node is added, removed, changed, or when a user is promoted or demoted.
  5. Understand the PVDC view distance priority system

    The PlayerViewDistanceController (PVDC) uses a priority system to determine which view distance to set for a player. All resulting values are clamped between the minimum and maximum values defined in the config.yml file. Note that this priority logic excludes AFK, dynamic mode, and ping mode behaviors.
  6. Understand and use PVDC Dynamic Mode

    Dynamic mode is a server-wide feature in PVDC that optimizes the view distance of all players based on the server's current MSPT. Instead of setting view distance to a fixed value, it reduces the view distance by a specific number of chunks from the player's maximum allowed distance. This ensures that the relative ratio of view distance permissions between players is maintained.

    Dynamic mode can be used independently or in conjunction with ping mode. Players with the permission node pvdc.dynamic-mode-bypass are exempt from these automatic reductions.

  7. Understand Simulation Distance behavior

    Simulation distance defines the square region of chunks around a player where entities are ticked. For example, a distance of 6 allows entities to move normally within a 13×13 chunk column around the player. In the one-chunk-thick frame immediately surrounding this region, redstone may run, fluids may flow, and crops may grow. Beyond this boundary, no movement or changes occur. Entities, complex redstone circuits, and fluids will not tick if they fall outside the simulation distance.
  8. Manage player view distance data and join notifications

    Control whether player view distance preferences are persisted to disk and whether players receive notifications about their current view distance upon joining the server.
    # Save preferences to disk; if false, players reset to default/LuckPerms settings each session
    save-player-data: true
    
    # Notify player of their view distance on join (only if afkOnJoin is false)
    display-msg-on-join: true
    
    # Notify player on join only if they are at default or maximum distance
    display-max-join-msg: false
    
    # Notify player of their distance and the maximum they can change it to
    display-max-change-join-msg: true
  9. Configure bypass permissions for operators during migration

    When migrating, ensure that operators are explicitly assigned the necessary permission nodes for bypass permissions. Operators who do not have these specific permission nodes assigned will lose all three bypass permissions.
  10. Create a custom language file for PVDC

    To create a custom language, use the English (en_US.yml) keys as a template and provide your own translated values. Save the resulting file in the /lang folder and update the language setting in config.yml to match your new filename.
  11. Manage player view distance data files

    The PlayerViewDistanceController plugin stores view distance data for players in individual YAML files located at /PlayerViewDistanceController/players/PLAYERUUID.yml.

    While these files can be edited manually, it is recommended to use plugin commands instead. If manual editing is required, the player must be offline to prevent the plugin from overwriting changes.

  12. Migrate PVDC plugin to version 1.3.0

    When upgrading to version 1.3.0, perform the following breaking changes and updates:

    • Update permission nodes according to the current permissions documentation.
    • Stop using the setchunks command, as it has been completely removed.
    • Review the priority system documentation, as the priority logic has been overhauled.
    • Move custom message configurations from config.yml to the /lang folder.
    • For name prefixes, use LuckPerms, as the internal prefix system has been removed. Bedrock-specific options should still be configured in config.yml.