NewPlayerPanel

Player Restrictions System & Villager Tracker Module

25

Quick challenge

How far can you run before the mobs catch you?

NewPlayerPanel

NewPlayerPanel v3.0.2

Features

Villager Tracking Module

The villager tracking module provides comprehensive monitoring and logging of villager death events:

- Data Cleanup: Automatically tracks all villager deaths with full metadata - Data Cleanup: Records player name, UUID, and associated information - Data Cleanup: Saves precise coordinates (X, Y, Z) and world name for each event - Data Cleanup: Identifies and records the specific villager type - Data Cleanup: Captures enchantment data from villager trades - Data Cleanup: Clickable coordinates for instant teleportation to villager death location - Data Cleanup: Coordinates in villager death notifications are clickable for quick teleportation - Data Cleanup: Automatic detection of the correct dimension (overworld/nether/end) for proper teleportation between worlds - Data Cleanup: Query records by player name, coordinates, or combined criteria - Data Cleanup: Real-time notifications for administrators with appropriate permissions - Data Cleanup: Automatic cleanup of historical records based on time criteria

Player Restrictions System

Advanced restriction system allowing precise control over player actions:

- Default Time-Based Restrictions: Support for EQUIPMENT, ITEM, ENTITY, and COMMAND restrictions - Default Time-Based Restrictions: Automatic application of restrictions based on player's time on server - Default Time-Based Restrictions: Configure temporary or permanent restrictions - Default Time-Based Restrictions: Create and modify restrictions through command interface - Default Time-Based Restrictions: Precise restriction configuration using action types (DAMAGE, USE, DROP, EQUIP, EXECUTE) - Default Time-Based Restrictions: Apply individual restrictions that override default settings - Default Time-Based Restrictions: Restrictions are checked and applied every 0.1 seconds - Default Time-Based Restrictions: Players can view their active restrictions using `/restrictions` - Default Time-Based Restrictions: Default restrictions count time from player's first join, not from server start

Storage Systems

Multiple storage backends for maximum flexibility:

- MariaDB Support: File-based storage using JSON format in plugin data directory - MariaDB Support: Lightweight embedded SQLite database (default, no configuration required) - MariaDB Support: Full integration with MySQL database with connection pooling - MariaDB Support: Native MariaDB database support with optimized queries

Localization

Full internationalization support:

- Real-Time Language Switching: Full support for Russian and English languages included - Real-Time Language Switching: Easy to add additional languages through message files - Real-Time Language Switching: All user-facing text can be modified through configuration - Real-Time Language Switching: Change language without server restart

---

Commands

Administrative Commands

| Command | Description | Permission | Usage Example | |---------|-------------|------------|---------------| | `/npp reload` | Reloads plugin configuration and applies changes | `newplayerpanel.admin` | `/npp reload` | | `/npp addrestriction` | Creates a new restriction definition | `newplayerpanel.admin` | `/npp addrestriction elytra_ban EQUIPMENT EQUIP minecraft:elytra time:-1 default:false` |

Command Syntax: ``` /npp addrestriction <name> <type> <actions> [targets...] [time:N] [default:true/false] ```

History Commands

| Command | Description | Permission | Usage Example | |---------|-------------|------------|---------------| | `/history` | Displays all villager death records | `newplayerpanel.history` | `/history` | | `/history <player>` | Shows records for a specific player | `newplayerpanel.history` | `/history Steve` | | `/history <x> <y> <z>` | Shows records near coordinates | `newplayerpanel.history` | `/history 100 64 200` | | `/history coords` | Shows records at your current location | `newplayerpanel.history` | `/history coords` | | `/history purge <time>` | Deletes records older than specified time | `newplayerpanel.history.purge` | `/history purge 7d` |

Time Format Examples: - `7d` - 7 days - `30d` - 30 days - `1h` - 1 hour - `2w` - 2 weeks - `1M` - 1 month

Restriction Management Commands

| Command | Description | Permission | Usage Example | |---------|-------------|------------|---------------| | `/restrict <player> <restriction> <time>` | Applies a restriction to a player | `newplayerpanel.restrictions.restrict` | `/restrict Steve elytra_ban 3600` | | `/unrestrict <player> <restriction|all>` | Removes restriction(s) from a player | `newplayerpanel.restrictions.restrict` | `/unrestrict Steve elytra_ban` | | `/restrictions` | Displays your active restrictions | `newplayerpanel.restrictions.view` | `/restrictions` | | `/restrictions [player]` | Displays active restrictions of a player | `newplayerpanel.restrictions.view.others` | `/restrictions Steve` |

Time Values: - `-1` - Permanent restriction - `0` - Remove restriction - `>0` - Duration in seconds (e.g., `3600` = 1 hour)

Note: Players can view their restrictions by using `/restrictions` without arguments. Administrators can view other players' restrictions by specifying the player name.

---

Permissions

| Permission Node | Description | Default Access | |----------------|-------------|----------------| | `newplayerpanel.admin` | Full administrative access to `/npp` commands | Operators only | | `newplayerpanel.history` | View villager death history records | Operators only | | `newplayerpanel.history.purge` | Permission to purge old history records | Operators only | | `newplayerpanel.notify` | Receive notifications about villager deaths | Operators only | | `newplayerpanel.restrictions.bypass` | Bypass all restrictions from configuration | Operators only | | `newplayerpanel.restrictions.restrict` | Apply and remove player restrictions | Operators only | | `newplayerpanel.restrictions.view` | View your active restrictions | All players | | `newplayerpanel.restrictions.view.others` | View other players' restrictions | Operators only |

---

Configuration

Main Configuration File (`config.yml`)

```yaml language: en storage: H2 database: host: localhost port: 3306 database: newplayerpanel username: root password: "" pool: maximum-pool-size: 10 minimum-idle: 2 connection-timeout: 30000 idle-timeout: 600000 max-lifetime: 1800000

villager-tracker: only-traded: true notify-enabled: true save-debug-files: false ```

Restrictions Configuration File (`restrictions.yml`)

```yaml restrictions: - name: elytra_ban type: EQUIPMENT actions: EQUIP item: [minecraft:elytra] time: -1 default: false

- name: tnt_restriction type: ITEM actions: USE item: [minecraft:tnt] time: 28800 default: true

- name: villager_hit_restriction type: ENTITY actions: DAMAGE entity: [minecraft:villager] time: -1 default: false ```

Restriction Types

| Type | Description | Target Field | |------|-------------|--------------| | `EQUIPMENT` | Restricts equipping items in armor/elytra slots | `item` | | `ITEM` | Restricts using or placing items | `item` | | `ENTITY` | Restricts interaction with entities | `entity` | | `COMMAND` | Restricts command execution | `command` |

Action Types

| Action | Description | |--------|-------------| | `DAMAGE` | Dealing damage to entities | | `USE` | Using or placing items | | `DROP` | Dropping items | | `EQUIP` | Equipping items in armor/elytra slots | | `EXECUTE` | Executing commands |

Restriction Logic

player's first join - When `default: true`, restrictions are automatically applied to all players - Time is calculated from player's first join (not from server start time) - Example: If `time: 3600` (1 hour), restriction applies during the first hour after player's first join - If `time: -1`, restriction is permanent for all players - Default restrictions are automatically removed when time expires

override - Applied through `/restrict` command - Time is calculated from override (not from player's first join) - Personal restrictions override default restrictions - If a player has a personal restriction, default restrictions with the same name are ignored - Personal restrictions can be manually removed using `/unrestrict`

Priority Order: 1. Personal restrictions (highest priority) 2. Default restrictions (if no personal restriction exists)

Viewing Restrictions: - Players can view their restrictions: `/restrictions` - Administrators can view any player's restrictions: `/restrictions <player>` - Both personal and default restrictions are displayed with remaining time

---

Storage Systems

YAML/JSON Storage

File-based storage using JSON format. All data is stored in `plugins/NewPlayerPanel/data/`: - `messages.json` - Localization messages - `villager_deaths.json` - Villager death records - `restrictions.json` - Player restriction data

Advantages: - No database setup required - Easy to backup (copy files) - Human-readable format

Configuration: ```yaml storage: YAML ```

H2 Database (Default)

Embedded SQLite database stored as `plugins/NewPlayerPanel/database.db`.

Advantages: - No external dependencies - Automatic setup - Good performance for small to medium servers

Configuration: ```yaml storage: H2 ```

MySQL Database

Full integration with MySQL database with connection pooling via HikariCP.

Advantages: - Scalability for large servers - Support for multiple server instances - Advanced query capabilities

Configuration: ```yaml storage: MYSQL database: host: localhost port: 3306 database: newplayerpanel username: root password: your_password ```

MariaDB Database

Native MariaDB support with optimized connection handling.

Advantages: - MariaDB feature compatibility - High performance - Enterprise-level reliability - Optimized connection with proper parameters - Automatic column checking and addition for backward compatibility

Configuration: ```yaml storage: MARIADB database: host: localhost port: 3306 database: newplayerpanel username: root password: your_password pool: maximum-pool-size: 10 minimum-idle: 2 connection-timeout: 30000 idle-timeout: 600000 max-lifetime: 1800000 ```

Compatibility

Supported Server Software

- Any Bukkit-based server - Full compatibility - Any Bukkit-based server - Full compatibility - Any Bukkit-based server - Compatible with standard Bukkit API

Minecraft Versions

- 1.21.x - Fully supported - Future versions - Should work with API version 1.20+

Java Requirements

- Java 21 - Minimum required version - Java 21 - Recommended for optimal performance

Database Requirements (if using MySQL/MariaDB)

- MariaDB 10.3+ - MariaDB 10.3+ - Database must support UTF-8 encoding

---

Support and Documentation

- Plugin Version: Math_Tereegor - Plugin Version: MISQZY and 6oJIeH - Plugin Version: 3.0.2

ADS