NightMarket v1.14 - The API & Integration Update This update focuses on improving stability with third-party plugins and significantly expanding the developer API to allow for deeper integrations.
✨ New Features
Developer API Expansion
A major focus of this update was to empower other developers to build amazing things on top of NightMarket. The API has been expanded with new events and methods.
New Custom Events: You can now listen for when the market's state changes. This is perfect for integrations with plugins like Citizens to spawn/despawn an NPC vendor automatically.
MarketOpenEvent: Fired whenever the market opens (both scheduled and forced). It includes a method isForced() to check if it was opened by an admin command.
MarketCloseEvent: Fired whenever the market closes (both scheduled and forced). It also includes the isForced() method.
New API Methods: We've added several static methods to the APIManager class for easy, direct access to the market's status from your own plugins:
APIManager.isMarketOpen(): Returns true if the market is currently open.
APIManager.getTimeRemainingSeconds(): Returns the time left in the current cycle as a long.
APIManager.getFormattedTimeRemaining(): Returns a user-friendly formatted string of the remaining time (e.g., "1d 12h 30m").
Bug Fixes
Fixed Economy Provider Race Condition: Corrected a critical issue where NightMarket would fail to hook into custom economy providers (like CRYSTALS) during server startup.
The Problem: NightMarket was attempting to initialize its economy connection before other plugins had a chance to register their custom APIs.
The Solution: The economy setup process is now deferred by one server tick, ensuring all other plugins are fully loaded. This resolves the Invalid or unregistered economy provider error on startup and removes the need to use /nm reload to make it work.