NightMarket v1.10 - The Barter Update
This update introduces a major new feature allowing for a more immersive and flexible server economy, alongside important clarifications and bug fixes.
✨ New Feature: Item-Based Economy (Bartering)
You can now set prices for Night Market items using other in-game items instead of relying solely on an economy plugin like Vault or PlayerPoints. This feature is
optional and can be mixed with the traditional currency system on an item-by-item basis.
How It Works:
- A new section, required_items, has been added to the item configuration in items.yml.
- If an item has the required_items section, the plugin will ignore the standard price: key and will instead check the player's inventory for the specified items upon purchase.
- You can require one or multiple types of items as payment.
- You can specify custom names and lore for the required items, allowing for complex custom currency (e.g., "Ancient Coins," "Event Tokens").
Configuration Changes:
- items.yml: To set an item's price to other items, use the new required_items list.
Code (Text):
items:
example_item:
chance: 5.0
stock: 1
required_items:
- material: DIAMOND
amount: 5
- material: GOLD_NUGGET
amount: 10
name: '&6Ancient Coin'
display_item:
# ...
commands_on_click:
# ...
- config.yml: A new message has been added for when a player cannot afford a barter trade. Please add the following line to your messages: section:
Code (Text):
messages:
# ... your other messages
not_enough_items: '&cYou do not have the required items to purchase this.'
(If you don't add this, a default English message will be used.)
Bug Fixes & Improvements
- Clarified Failed to assign unique item Warning: The console warning [WARN]: Failed to assign a unique item for player... has been identified as a configuration issue, not a plugin bug. This warning correctly appears when there are fewer unique items defined in items.yml than there are available slots in the GUI. The solution is to add more item variety to your items.yml file. The plugin is functioning as intended by preventing duplicate items for a player.
- Improved Code Structure: The economy handling system has been refactored to seamlessly support both traditional currency and the new item-based system.
Thank you for using NightMarket! We hope you enjoy the new bartering possibilities.