VillagerTradeEdit

Edit villager trades in-game and turn a villager into a little shop. Made for Folia, with support for Paper, Purpur and Canvas too.
"I just couldn't wait for Shopkeepers to support Folia, so... I made one myself."
What it does
- Shift-right-click a managed villager to edit trades. Each column is one trade: what players pay, an optional second item, and what they get. The editor also sets the villager's name (MiniMessage or legacy colours), profession, biome type and level.
- Right-click to trade. You can also require a permission to trade with a villager.
/vte summonspawns a villager that stays put, can't be hurt and won't get pushed around by explosions.- Prices stay as you set them—no reputation or Hero of the Village discounts. Trades are saved on the villager and restored when the chunk loads.
- Tired of the "hmm"? Turn on
mute-villager-soundin the config.
Commands
| Command | What it does |
|---|---|
/vte summon |
Spawn a managed villager |
/vte select |
Select the villager you're looking at |
/vte list |
List managed villagers with their IDs |
/vte tp <id> |
Teleport to one |
/vte tphere <id> |
Bring one to you |
/vte moveto <id> <x> <y> <z> |
Move one |
/vte reload |
Reload the config |
Permissions
villagertradeedit.open— open the trade editorvillagertradeedit.command— use/vtevillagertradeedit.command.summon,villagertradeedit.command.reload— per-subcommand permissions
Requirements
- Paper / Purpur / Folia / Canvas 26.1 or newer
- Java 25
- YskLib 1.9.0+
Still on 1.21.x? Use VillagerTradeEdit 1.4.10.
Setup
- Drop the plugin jar and
YskLib.jarintoplugins/. - Restart the server.
- Run
/vte summon, then shift-right-click the villager to add trades.
Something broken?
Open an issue on GitHub or come say hi on Discord. Logs help a lot.
All Versions
+ Add Version### Fixes
- When a second player opened a managed villager, the first player's trade window closed. Any number of players can now trade with the same villager at the same time.
### Fixes
- Folia: the editor failed to reopen after the name or permission chat prompt (
Cannot init menu async). It now reopens on the player's region thread. - Name and permission prompts registered a new chat listener every click and never cleaned up if the player didn't reply. One handler now, cleared on quit.
- With CMI installed, the reply you typed into a prompt showed up in your own chat. The prompt now cancels the legacy chat event first, ahead of CMI.
### Fixes
- Folia:
IllegalStateException: Cannot getEntities asynchronouslyspam fromonPlayerMovewhen another plugin firesPlayerMoveEventoff the player's region thread (e.g. CMI/ride). The villager-turn scan now runs on the player's region viarunAtEntityand skips rotation-only moves. Fixes #17.
mute-villager-sound option to silence managed villagers' idle/trade noise, plus explosion and save-crash fixes.### Added
mute-villager-soundconfig option — settrueto mute managed villagers' "hmm"/trade sounds.
### Fixes
- Managed villagers no longer get shoved out of place by creeper/TNT explosions.
- Fixed a crash saving villagers with large trade lists (
UTFDataFormatException). 2.1.0 villagers still load fine. - Folia: skip the shutdown save loop that could trip thread violations; auto-save still persists everything.
/vte select, /vte deselect, /vte tp, /vte tphere, /vte moveto, and /vte list. Each managed villager gets a persistent ID, assigned lazily on chunk load. Managed villagers no longer fall on spawn — gravity is disabled, and re-applied to existing ones on chunk reload.### Fixes
- Villagers whose trades were wiped by the old 1.4.10 rename/permission bug no longer crash entity loading with "Unable to load trades". They now load with an empty trade list (the wiped data is unrecoverable — fix just stops the crash). Healthy villagers migrate normally with full trades intact.
- Opening the trade GUI on Paper/Folia/Canvas 26.1 no longer throws an error.
- Right-clicking a managed villager to trade no longer throws an error.
For 1.21.x servers stay on **1.4.10**.
- Requires JDK 25
- Requires YskLib 1.9.0+ (https://github.com/YusakiDev/YskLib/releases/tag/v1.9.0)
For 1.21.x servers stay on 1.4.10.
- Fixed renaming or setting permission on a villager wiping its trades
- Fixed chat prefix showing "Message not found: prefix" with newer YskLib versions
- Added Ability to change Varients and Levels
- Change Layout a bit
- Minor Update Ignoring Mob-Spawning Block
- Server Sleep Mode Data Loss** - Fixed critical issue where villager trades disappeared after servers wake from sleep mode (specifically reported on PebbleHost servers with 60-second idle sleep). Villagers now correctly retain their custom trades through sleep/wake cycles.
## New Features
- EntitiesLoadEvent Handler** - Added entity load event listener to catch villager loads even when chunks remain loaded, ensuring data restoration regardless of chunk state
- Shutdown Data Persistence** - Implemented automatic save of all managed villagers during plugin disable to prevent data loss during server sleep/shutdown cycles
- Startup Data Restoration** - Added automatic restoration of already-loaded villagers on plugin enable to handle plugin reloads and server wake-ups
## Improvements
- Enhanced Debug Logging** - Added detailed logging with trade counts, profession info, and UUIDs to make troubleshooting and verification easier
- Synchronous Storage Method** - Implemented synchronous data storage option for shutdown scenarios to prevent async scheduling issues
## Bug Fixes
- Fixed villager trades disappearing after server sleep/wake cycles
- Resolved issue where ChunkLoadEvent wasn't firing for already-loaded chunks during server wake
- Prevented data loss when plugin disables during sleep mode
- Fixed non-functional GUI after editing villager name or permission** - Editor GUI now properly re-registers inventory mappings and re-renders the page when reopening after name/permission edits, allowing continued trade editing and interaction
- Configurable Message Prefix** - Added support for customizable message prefix via configuration, allowing servers to brand plugin messages with their own prefix or theme
- Command Aliases** - Introduced command alias support, enabling custom alternate command names to be configured for better integration with existing server commands
## Improvements
- UUID-based Villager Tracking** - Refactored villager state and permission tracking to use UUIDs instead of object references, significantly improving data consistency across chunk reloads and entity instance changes
- Config Migration System** - Implemented versioned configuration migration to automatically upgrade config files between releases
- Debug Level Enhancement** - Converted debug option from simple boolean to numeric levels (0-3) for more granular debugging control
## Technical Changes
- Updated YskLib dependency from 1.6.2 to 1.6.7
- Enhanced config reload logic to properly reapply aliases and messages
## Bug Fixes
- Improved reliability of villager state persistence across chunk unloads/reloads
- Fixed potential issues with villager tracking when entity instances change
- Migrated from deprecated YskLib messaging methods to the modern MessageManager module.
- Enhanced messaging system now supports:
- Cached message loading for better performance
- Multi-line message support
- More flexible placeholder system using Map-based placeholders
- Additional helper methods for retrieving messages programmatically
- Fixed "Messages not loaded for VillagerTradeEdit" error by adding explicit message loading during plugin initialization.
## Improvements ✨
- Enhanced message system integration with YskLib for proper localization support.
- Expanded configuration messages section with all user-facing text now customizable.
- Updated YskLib dependency to version 1.6.2 for improved world management capabilities.
- Added support for wildcard (
'*') inenabled-worldsconfiguration to enable plugin across all worlds.
- Ysklib 1.6.2 Required !!!!!**
https://github.com/YusakiDev/YskLib/releases/tag/1.6.2
- Version Bump**: Updated to 1.4.2.
- Better Price Handling**: Only managed villagers use stable trade prices. Regular villagers keep their normal price swings.
- Hero of the Village Fix**: The status effect is only paused when editing managed villagers, so it stays intact for normal trades.
- Fix Shading
- Personal Trading**: Each player now gets their own trading window with managed villagers, so multiple people can trade at once.
- No Random Discounts**: Trade prices stay steady—no surprise price hikes or Hero of the Village discounts.
- Custom Names & Permissions**: Rename villagers with colors or styles, and set who can trade with each one.
- Always Static Villagers**: Managed villagers stay put and won’t wander or get bumped around.