NewPlayerPanel
PluginMIT

NewPlayerPanel

Player Restrictions System & Villager Tracker Module

14
Downloads
0
Followers
4 months ago
Updated
📦
2
Versions

📖About NewPlayerPanel

NewPlayerPanel v3.0.2

Features

Villager Tracking Module

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

  • Death Event Recording: Automatically tracks all villager deaths with full metadata
  • Killer Identification: Records player name, UUID, and associated information
  • Location Tracking: Saves precise coordinates (X, Y, Z) and world name for each event
  • Villager Type Detection: Identifies and records the specific villager type
  • Enchantment Preservation: Captures enchantment data from villager trades
  • Interactive Coordinates: Clickable coordinates for instant teleportation to villager death location
  • Clickable Teleport in Notifications: Coordinates in villager death notifications are clickable for quick teleportation
  • Automatic Dimension Detection: Automatic detection of the correct dimension (overworld/nether/end) for proper teleportation between worlds
  • Advanced Search: Query records by player name, coordinates, or combined criteria
  • Notification System: 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:

  • Multiple Restriction Types: Support for EQUIPMENT, ITEM, ENTITY, and COMMAND restrictions
  • Default Restrictions: Automatic application of restrictions based on player's time on server
  • Time Control: Configure temporary or permanent restrictions
  • In-Game Management: Create and modify restrictions through command interface
  • Action Granularity: Precise restriction configuration using action types (DAMAGE, USE, DROP, EQUIP, EXECUTE)
  • Personal Overrides: Apply individual restrictions that override default settings
  • Real-Time Application: Restrictions are checked and applied every 0.1 seconds
  • Player Viewing: 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:

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

Localization

Full internationalization support:

  • Multi-Language: Full support for Russian and English languages included
  • Extensibility: Easy to add additional languages through message files
  • Customizable Messages: 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)

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)

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

Default Restrictions:

  • 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

Personal Restrictions:

  • Applied through /restrict command
  • Time is calculated from application moment (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:

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:

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:

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:

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

  • Spigot - Full compatibility
  • Purpur - 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 17 - Minimum required version
  • Java 21 - Recommended for optimal performance

Database Requirements (if using MySQL/MariaDB)

  • MySQL 8.0+
  • MariaDB 10.3+
  • Database must support UTF-8 encoding

Support and Documentation

  • Author: Math_Tereegor
  • Help and Support: MISQZY and 6oJIeH
  • Plugin Version: 3.0.2