Minor Bug Fixes
- Fixed Access global region thread To specific region thread In Folia Compatibility
- Other Minor Bug Fixes
Minecraft Villager Trade Manager โ Version 10.0
โInstant Restock Updateโ
๐ Key Features Implemented
1. Instant Restock System
- โ
Added
instantRestockEnabledboolean flag for instant restocks. - โ
New command:
/villagertrade instantrestock on/off. - โ Villager trades automatically replenish immediately after use.
- โ Platform-safe execution: Folia uses region-threaded scheduling; other platforms use synchronous execution.
2. Database Integration
- โ
Instant restock setting persisted in SQLite
settingstable. - โ
Automatic loading and saving of
instantRestockEnabled. - โ Fully backward compatible with existing database schema.
3. Enhanced Status Display
- โ
/villagertrade statusnow shows Instant Restock status. - โ Clear On/Off indication for administrators.
4. Smart Integration
- โ Instant restock takes precedence over interval-based restocks.
- โ Normal restock system skips processing while instant restock is enabled.
- โ
Seamless integration with existing restock features (
restocktime,restocklimit,unlimitedrestock).
5. Command System Updates
- โ
Added
instantrestocksubcommand. - โ Updated usage help text to include new command.
- โ
Tab completion for
on/offvalues. - โ Updated main command usage message to reflect new options.
6. Performance Optimizations
- โ Efficient instant restock processing with minimal CPU overhead.
- โ Minimal performance impact when feature is disabled.
- โ Platform-appropriate scheduling for optimal performance on Folia and legacy servers.
๐งฉ Compatibility
- Fully compatible with: Folia, Paper, Purpur, Spigot, Bukkit
- Minecraft versions: 1.20.x โ 1.21.x
- Java: 17+
โ๏ธ Migration Notes
- Upgrade from v9.0 is seamless.
- Existing settings, prices, and restock data are preserved.
- No server restart required for migration.
๐ Summary
v10.0 introduces Instant Restock, giving server admins full control to replenish villager trades immediately, while maintaining compatibility, thread safety, and performance across all supported platforms.
๐งพ Minecraft Villager Trade Manager v9.0
The Folia Expansion Update
๐ Major Features
Folia Native Compatibility
- Full Region-Threaded Support: Native compatibility with Foliaโs region-based concurrency model.
- Automatic Platform Detection: Detects Folia, Paper, Purpur, Spigot, and Bukkit automatically.
- Seamless Integration: Works transparently without configuration changes.
- Backward Compatibility: 100% retained functionality on all legacy platforms.
Advanced Scheduler Abstraction
- Unified TaskScheduler Interface: Single abstraction for scheduling tasks across all supported servers.
- FoliaScheduler Implementation: Region-threaded scheduling using Foliaโs APIs.
- BukkitSchedulerWrapper: Legacy scheduler for Paper, Spigot, Purpur, and Bukkit.
- Entity & Location Safe: All entity and location operations respect Foliaโs thread-safety rules.
Asynchronous Database Operations
- Thread-Safe Database Executor: Dedicated async thread pool for SQLite operations.
- Non-Blocking I/O: Prevents main-thread lag by running all DB tasks asynchronously.
- Configurable Thread Pool: Adjust thread count for optimal performance.
- Graceful Shutdown: Automatic cleanup of async resources.
๐ ๏ธ Technical Improvements
Platform Detection Service
- Automatic Recognition: Detects server platform at runtime.
- Adaptive Behavior: Adjusts scheduler and async methods accordingly.
- Detailed Logging: Shows platform information on startup.
- Safe Fallbacks: Gracefully handles missing APIs on unsupported versions.
Thread Safety Enhancements
- Region-Safe Entity Access: All villager actions use Folia-safe execution.
- Concurrent Data Access: Thread-safe operations for restock and trade data.
- Cross-Platform API Safety: Reflection-based compatibility layer.
- Improved Exception Handling: Safe and recoverable async operations.
Performance Optimizations
- Reduced Main Thread Load: All blocking tasks moved to async.
- Efficient Resource Management: Improved thread pooling and connection handling.
- Memory Optimization: Low-overhead caching mechanisms.
- Optimized Scheduling: Best scheduling method automatically selected per platform.
๐ Compatibility Enhancements
Multi-Platform Support
- โ Folia (1.20.xโ1.21.x)
- โ Paper (1.20.xโ1.21.x)
- โ Purpur (1.20.xโ1.21.x)
- โ Spigot (1.20.xโ1.21.x)
- โ Bukkit (1.20.xโ1.21.x)
Version Range
- Minecraft: 1.20.x โ 1.21.x
- Java: 17+
API Integration
- Reflection-Based Access: Ensures compatibility across API variants.
- Graceful Fallbacks: Automatically uses the best available scheduler.
- Future-Proof Design: Modular structure ensures easy updates.
๐ System Architecture
Modular Design
- Scheduler Layer: Unified async/sync scheduling.
- Platform Layer: Detection & adaptation services.
- Database Layer: Async persistent storage.
- Business Logic Layer: Core villager trade management.
Resource Management
- Thread Pool Management: Configurable async threads.
- Connection Handling: Automatic open/close cycle for DB connections.
- Memory Optimization: Efficient caching and cleanup.
- Safe Shutdown: Proper termination of all async tasks.
๐ฏ Feature Preservation
All features from v8.0 are maintained and improved:
- Custom Trade Pricing
- Discount Prevention
- Custom Restock System (intervals, limits, unlimited)
- Command Suite (
/villagertrade setprice,/villagertrade restock, etc.) - SQLite Persistent Data Storage
Enhanced Reliability
- Better error recovery
- Strong data consistency
- Improved async logging
๐ Performance Benefits
Scalability
- Supports servers with 1000+ villagers
- <1% tick usage even under high load
- Fully async database and trade logic
Operational Efficiency
- Fast startup
- No blocking on main thread
- Safe async resource cleanup
๐ง Implementation Details
New Components
TaskSchedulerInterfaceFoliaScheduler(region-threaded scheduler)BukkitSchedulerWrapper(legacy scheduler)PlatformService(detection and adaptation)AsyncDatabaseExecutor(thread-safe DB layer)
Codebase Improvements
- Modularized architecture
- Full backward compatibility
- Comprehensive inline documentation
- Future-ready design
๐ Migration Notes
- Seamless Upgrade: Drop-in replacement, no config changes.
- Data Preservation: Existing settings and prices remain intact.
- Command Compatibility: No breaking command changes.
- Zero Downtime: Upgrade from v8.0 without restart issues.
โ Summary
Minecraft Villager Trade Manager v9.0 โ The Folia Expansion Update
Now supports Foliaโs region-threaded architecture while maintaining full compatibility with Paper, Purpur, Spigot, and Bukkit.
Bringing safe async performance, universal scheduling, and next-level stability to villager trade management.
๐ New in v8.0 โ The Restock Update
โ๏ธ Custom Restock System
Take command of villager restocking behavior with full flexibility:
/villagertrade restock on/offโ Enable or disable the custom restock system./villagertrade restocktime <minutes>โ Set the restock interval (default: 30 minutes)./villagertrade restocklimit <count>โ Set the daily restock limit (default: 5 restocks/day)./villagertrade unlimitedrestock on/offโ Toggle unlimited villager restocks.
โ
Fully compatible with all villager professions and levels.
โ
Automatically resets restock counts daily.
โ
Smart, lightweight system monitored every minute.
๐งฉ Database Integration
- SQLite-based persistent storage for all settings and restock data.
- Includes two new tables:
settingsโ Saves custom configuration values.villager_restock_dataโ Tracks each villagerโs individual restock usage.
- Thread-safe operations using
ConcurrentHashMap.
๐ Enhanced Status Display
/villagertrade status now shows:
- Restock system status (enabled/disabled).
- Current restock interval and daily limits.
- Unlimited restock toggle state.
- Price system status and stored price configurations.
Minecraft Villager Trade Manager
Complete control over villager trading economics with custom pricing and discount prevention
Minecraft Villager Trade Manager is a comprehensive Paper/Spigot plugin that gives server administrators complete control over villager trading economics. Take control of trade prices, eliminate exploitative discounts, and create a fair, balanced trading experience for all players.
๐ฏ Features
Complete Trade Control
- Set custom prices for any villager trade, especially enchanted books
- Lock in fixed prices that never change regardless of player reputation
- Prevent all forms of trade manipulation and exploitation
Discount Prevention System
- Eliminate Hero of the Village effects and free gifts
- Remove reputation-based trade discounts
- Prevent price inflation from overused trades
- Maintain static pricing across all trading scenarios
Custom Pricing Engine
- Set specific emerald costs for enchanted books (Fortune, Efficiency, Protection, etc.)
- Configure prices for any enchantment level (Fortune I, Fortune II, Fortune III)
- Automatic price capping at 64 emeralds per trade
- Consistent 1-book cost for all enchanted book trades
Universal Compatibility
- Works with Minecraft versions 1.20.x through 1.21.x
- Compatible with Paper and Spigot server implementations
- Automatic adaptation to server capabilities
- No conflicts with other plugins
User-Friendly Management
- Simple command system:
/villagertrade setprice <enchant> <level> <price> - Intelligent tab completion for all enchantments and levels
- Real-time status monitoring and price management
- Persistent storage with automatic data saving
๐ Installation
- Download the latest release from the Releases page
- Place the
.jarfile in your server'spluginsfolder - Restart your server
- The plugin will automatically create its configuration files
๐ฎ Commands
| Command | Description | Permission |
|---|---|---|
/villagertrade on |
Enable trade management system | villagertrade.manage |
/villagertrade off |
Disable trade management system | villagertrade.manage |
/villagertrade status |
View current custom prices and system status | villagertrade.manage |
/villagertrade setprice <enchant> <level> <price> |
Set custom prices for trades | villagertrade.manage |
Command Examples
# Set Efficiency I to cost 20 emeralds
/villagertrade setprice efficiency 1 20
# Set Protection IV to cost 35 emeralds
/villagertrade setprice protection 4 35
# Set Mending to cost 50 emeralds
/villagertrade setprice mending 1 50
# Set Fortune III to cost 40 emeralds
/villagertrade setprice fortune 3 40
Version 6.0 - Multi-Version Compatibility Release
โก Major Features Cross-Version Compatibility: Now supports Minecraft versions 1.20.x through 1.21.x
Graceful Degradation: Automatically adapts to available server features
Version Detection System: Intelligently detects server capabilities at runtime
๐ ๏ธ Technical Improvements
API Version Independence: No longer tied to specific Minecraft version APIs
Reflection-Based Compatibility: Uses reflection for version-specific method calls
Fallback Implementations: Provides backup methods for older server versions
Feature Detection: Dynamically checks for Hero of the Village and Raid events
๐ Compatibility Enhancements 1.20.x Support: Full compatibility with all 1.20.x versions
1.21.x Support: Maintained compatibility with 1.21.x versions
Paper/Spigot: Works with both Paper and Spigot server implementations
Backward Compatibility: Maintains all existing functionality across versions
๐ Bug Fixes
Method Compatibility: Fixed NoSuchMethodError exceptions on older versions
Event Handling: Conditional event processing based on server capabilities
Entity Processing: Version-safe entity distance calculations
Potion Effects: Reflection-based potion effect removal for older versions
Version 5.0 - User Experience Improvements
๐ฏ Command System Overhaul
Simplified Syntax: /nodiscounts setprice <enchant> <level> <price>
Natural Language Commands: efficiency 1 instead of enchanted_book_efficiency_1
Intelligent Tab Completion: Context-aware suggestions for all parameters
๐ฐ Trading System Refinements
Consistent Book Costs: Exactly 1 book per enchanted book trade
Price Capping: Maximum 64 emeralds per trade (respects Minecraft stack limits)
Dynamic Level Limits: Tab completion shows correct max levels for each enchantment
๐ User Interface Improvements
Clear Error Messages: Helpful feedback for invalid commands
Better Status Display: User-friendly format for custom prices
Enhanced Help System: More examples and clearer usage instructions
Removed SQLite Dependency: Completely removed SQLite and replaced it with Java's built-in serialization
File-based Storage: Custom prices are now saved to plugins/NoDiscounts/prices.dat using Java serialization
ConcurrentHashMap: Used ConcurrentHashMap for thread-safe operations
No External Libraries: Eliminated all external SQLite dependencies that were causing conflicts
Simplified Persistence: Uses simple file I/O with object serialization instead of database operations
1 No Library Conflicts: Eliminates the SQLite library conflict with other plugins
2 Lightweight: No external dependencies beyond what's built into Java
Updated Sqlite Driver to 3.43.0.0
Changelog New Features
SQLite Database Integration: Custom trade prices are now stored in a persistent SQLite database (plugins/NoDiscounts/prices.db) instead of config files.
Full Enchantment Support: Added support for all enchantments, including modded ones.
Dynamic Tab Completion: Command tab completion now auto-suggests every enchantment and level combination available.
Enhanced Persistence: Custom prices survive restarts with robust database storage.
Improvements
Error Handling: Fixed ConcurrentModificationException in tab completion.
Performance: Optimized database operations and memory usage.
Compatibility: Works with all enchantments, vanilla and modded.
User Experience: Expanded command help with examples and formatting guides.
Technical Changes
Database Structure: Prices saved in custom_prices table (item_key, price).
File Location: Database auto-created at plugins/NoDiscounts/prices.db.
API Updates: Updated for Minecraft 1.21.4 (Paper/Spigot).
Memory Management: Fixed concurrent modification issues during tab completion.
Features
Disables All Villager Discounts (zombie curing, reputation, Hero of the Village).
Static Trade Prices (overused trades never inflate).
Preserves Villager Progression (leveling, unlocking trades, and refreshing).
Hero of the Village Removal (no free gifts).
Custom Pricing System
Set custom emerald prices for any enchanted book using this format:
enchanted_book_sharpness_5 โ Sharpness V
enchanted_book_protection_4 โ Protection IV
enchanted_book_mending_1 โ Mending I
Data persists permanently in SQLite.
Commands
/nodiscounts on โ Enable discount prevention
/nodiscounts off โ Disable discount prevention
/nodiscounts status โ Check plugin status + view custom prices
/nodiscounts setprice <item_key> <price> โ Set a custom price
Database Info
Location: plugins/NoDiscounts/prices.db
Table: custom_prices (item_key TEXT PRIMARY KEY, price INTEGER)
Auto-created on first run.
Examples
/nodiscounts setprice enchanted_book_sharpness_5 40
/nodiscounts setprice enchanted_book_protection_4 35
/nodiscounts setprice enchanted_book_mending_1 50
/nodiscounts status



