📄
pasted-code-1787933392045.txt
txt
1489 lines
▶
# MASTER PROMPT — CUSTOM BLACK MARKET PLUGIN FOR MINECRAFT SMP
You are an expert Minecraft Java plugin developer, server architect, resource-pack developer, UI/UX designer, and QA engineer.
I want you to build a **production-ready Black Market system** for my Minecraft SMP.
Do NOT make a simple `/blackmarket` GUI shop.
The Black Market must feel like a **secret underground illegal marketplace physically existing inside the Minecraft world**, with NPC dealers, custom items that do not exist in vanilla Minecraft, extremely expensive ore-block prices, limited stock, rotating inventory, custom abilities, custom textures/models through a resource pack, persistence, security, and complete configuration.
The result must be stable enough for a real multiplayer SMP.
---
# 1. CORE CONCEPT
Create a secret physical Black Market.
Players must physically travel to the Black Market location and interact with NPC/dealer villagers.
The Black Market sells:
1. Normal Minecraft items that are difficult/rare to obtain.
2. Illegal/contraband versions of existing items.
3. Completely CUSTOM items that do not exist in vanilla Minecraft.
4. Legendary/endgame items with unique abilities.
5. Extremely rare items that may appear only temporarily.
The strongest items must be extremely expensive.
The Black Market should become an endgame destination.
DO NOT make it feel like a normal Minecraft villager shop.
---
# 2. COMPATIBILITY
Before generating the plugin:
* Determine the exact Minecraft server version from my project/environment.
* Determine whether the server is Paper, Purpur, Spigot, or another supported server.
* Use APIs compatible with that version.
* Do NOT use deprecated APIs when a stable modern API exists.
* Do NOT blindly assume a Minecraft version.
* If the project already contains dependencies, inspect them first.
* Avoid dependency conflicts.
* Make all important systems configurable.
If a dependency is required, clearly specify:
* Dependency name
* Version
* Why it is required
* Whether it is required or optional
Prefer implementing systems directly in the plugin rather than requiring unnecessary dependencies.
---
# 3. PHYSICAL BLACK MARKET
The Black Market must exist at a configurable physical location.
Example:
/blackmarket setlocation
The location must be saved permanently.
The plugin must support:
* World
* X
* Y
* Z
* Yaw
* Pitch
The Black Market should NOT automatically appear at a random location unless configured to do so.
Players should be able to build their own Black Market environment.
Example layout:
BLACK MARKET
│
├── Arms Dealer
├── Artifact Dealer
├── Contraband Dealer
├── Forbidden Dealer
├── Legendary Dealer
└── Secret Dealer
Each dealer should be a physical NPC.
Prefer Minecraft villagers or configurable NPC entities.
---
# 4. DEALERS
Create configurable dealers.
Every dealer must have:
* Unique ID
* Display name
* NPC type
* Location
* Skin/model if supported
* Inventory
* Permission requirement if configured
* Availability schedule
* Restock behavior
Example:
Dealer ID:
arms_dealer
Display name:
"§8[§4Arms Dealer§8]"
The dealer must NOT move around randomly.
Prevent players from killing, pushing, stealing from, or manipulating the dealer.
Players should interact with the dealer using right-click.
---
# 5. BLACK MARKET ITEMS
This is the most important part.
The plugin must support CUSTOM ITEMS.
These items must be visually different from normal Minecraft items using a custom resource pack.
Every custom item must have:
* Unique internal ID
* Display name
* Lore
* Rarity
* Custom model
* Custom texture
* Custom item model / model data appropriate for the Minecraft version
* Abilities
* Cooldowns
* Durability/charges if applicable
* Trade price
* Maximum stock
* Appearance chance
* Dealer category
* Sound effects
* Particle effects
* Permission requirements if needed
Do NOT identify custom items only by their display name.
Use a reliable unique identifier such as a NamespacedKey/PersistentDataContainer or the appropriate modern equivalent.
Example:
blackmarket:soul_reaper
NOT:
display_name = "Soul Reaper"
because players can rename items with anvils.
---
# 6. EXAMPLE CUSTOM ITEMS
Create the architecture so I can add unlimited custom items later.
Include example items such as:
## SOUL REAPER
Type:
Custom Legendary Weapon
Price:
10 DIAMOND BLOCKS
+
45 NETHERITE BLOCKS
Ability:
When the player successfully damages another player, the weapon has a configurable chance to trigger Soul Drain.
Soul Drain:
* Deals additional damage.
* Creates dark particles.
* Plays a custom sound.
* Gives the attacker a small temporary regeneration/healing effect.
* Has a cooldown.
IMPORTANT:
Do not make the item instantly overpowered.
Everything must be configurable.
---
## VOID HEART
Type:
Legendary Artifact
Price:
20 DIAMOND BLOCKS
+
64 NETHERITE BLOCKS
Ability:
Creates a temporary Void Rift at the targeted location.
The effect may:
* Pull nearby mobs slightly toward the center.
* Apply configurable debuffs.
* Create black/purple particles.
* Play a custom sound.
* Disappear after a configurable duration.
Do not permanently destroy the world.
---
## STORM CORE
Type:
Legendary Artifact
Price:
15 DIAMOND BLOCKS
+
32 NETHERITE BLOCKS
Ability:
Target a location/player and summon controlled lightning.
Include:
* Cooldown
* Particle effects
* Sound
* Configurable damage
* PvP protection compatibility
---
## BLOOD CONTRACT
Type:
Forbidden Artifact
Price:
12 DIAMOND BLOCKS
+
50 NETHERITE BLOCKS
Ability:
Temporarily increases player power while applying a configurable health drawback.
---
## EYE OF THE VOID
Type:
Forbidden Artifact
Price:
25 DIAMOND BLOCKS
+
64 NETHERITE BLOCKS
Ability:
Short-range teleport.
Rules:
* Cannot teleport through protected regions.
* Cannot teleport into solid blocks.
* Cannot teleport into lava unless explicitly configured.
* Cannot bypass world borders.
* Has cooldown.
* Has particle and sound effects.
---
## FALLEN WINGS
Type:
Legendary Artifact
Price:
40 DIAMOND BLOCKS
+
100 NETHERITE BLOCKS
Ability:
Provides temporary controlled flight.
The flight must:
* Have a duration.
* Have a cooldown.
* Stop when the duration expires.
* Prevent abuse.
* Be configurable.
---
## NULL FRAGMENT
Type:
MYTHIC / SECRET
Price:
100 DIAMOND BLOCKS
+
256 NETHERITE BLOCKS
This should be one of the rarest items in the entire server.
Its exact ability should be configurable and expandable.
The architecture must support future progression systems involving NULL items.
---
# 7. PRICING SYSTEM
The Black Market must NOT use normal economy money unless explicitly enabled.
The primary currency is PHYSICAL MINECRAFT ITEMS.
Prices can contain:
* Diamond
* Diamond Block
* Netherite Ingot
* Netherite Block
* Emerald
* Emerald Block
* Gold
* Gold Block
* Ancient Debris
* Other configurable items
Example:
10 Diamond Blocks
+
45 Netherite Blocks
must literally require those physical items from the player's inventory.
DO NOT simply check whether the player has enough money.
---
# 8. SAFE TRADE SYSTEM
Trades must be completely atomic.
This is extremely important.
When a player purchases an item:
1. Verify the player is allowed to purchase it.
2. Verify the item is still in stock.
3. Verify the player still has all required payment items.
4. Lock the transaction.
5. Remove the exact required payment items.
6. Give the purchased item.
7. Decrease stock.
8. Save the transaction/state.
9. Unlock the transaction.
If any step fails:
* Do NOT remove the player's resources.
* Do NOT give the item.
* Restore the previous state.
* Inform the player.
Prevent:
* Double-click duplication
* Shift-click exploits
* Inventory desync
* Transaction duplication
* Race conditions
* Two players buying the final item simultaneously
* Server crash duplication
The transaction system must be server-authoritative.
---
# 9. LIMITED STOCK
Every Black Market item must support limited stock.
Example:
Soul Reaper:
Stock: 1
Void Heart:
Stock: 2
Storm Core:
Stock: 3
The stock must be visible to players.
Example:
"§7Stock: §c1/1"
When stock reaches zero:
"§cSOLD OUT"
The item must not be purchasable.
---
# 10. ROTATING INVENTORY
The Black Market inventory must automatically change.
Default:
Restock every 12 hours.
Make this configurable.
Possible values:
* 1 hour
* 3 hours
* 6 hours
* 12 hours
* 24 hours
* Custom duration
When restocking:
* Select items from the configured item pool.
* Respect rarity weights.
* Respect dealer categories.
* Respect maximum stock.
* Do not duplicate unique items unless configured.
* Save the generated inventory.
* Notify players if enabled.
IMPORTANT:
The inventory must persist through server restarts.
Do NOT regenerate the Black Market simply because the server restarted.
---
# 11. RARITY SYSTEM
Create:
COMMON
UNCOMMON
RARE
EPIC
LEGENDARY
MYTHIC
FORBIDDEN
SECRET
Each rarity must support:
* Display color
* Spawn/appearance weight
* Maximum stock
* Price multiplier
* Particle effects
* Sounds
Example:
COMMON = 40%
UNCOMMON = 25%
RARE = 15%
EPIC = 10%
LEGENDARY = 6%
MYTHIC = 3%
FORBIDDEN = 0.9%
SECRET = 0.1%
Make all values configurable.
---
# 12. UNIQUE ITEM APPEARANCE
Some items should be marked:
"ONE OF ONE"
When such an item appears:
* Only ONE can exist on the server.
* Once purchased, it disappears permanently unless an administrator resets it.
* It should not return during normal restocks.
This state must survive:
* Server restart
* Plugin reload
* Crash
* Player logout
---
# 13. BLACK MARKET OPEN/CLOSED SYSTEM
Add optional operating hours.
Example:
Black Market opens:
20:00
Black Market closes:
04:00
When closed:
* Dealers remain physically present.
* Trading is disabled.
* Players can optionally inspect upcoming items.
* A message says:
"§8The Black Market is closed."
Make opening hours configurable.
---
# 14. SECRET BLACK MARKET
Add an optional secret dealer.
The Secret Dealer:
* Has a hidden location.
* Does not appear in the normal Black Market GUI.
* Can sell extremely rare items.
* Has extremely low appearance rates.
* Can have special conditions.
Example:
A player may need:
* A specific item
* A specific score
* A specific achievement
* A specific time
* A specific permission
to access the Secret Dealer.
Make all conditions configurable.
---
# 15. DISCOVERY SYSTEM
Optional:
The plugin can send hints instead of directly revealing the location.
Example:
"§8Whisper: Someone says the Black Market has reopened..."
Then:
"The dealer is somewhere beneath the old ruins."
Do NOT automatically teleport players.
The server should encourage exploration.
---
# 16. CUSTOM RESOURCE PACK
This is mandatory.
Create a custom resource pack for all custom Black Market items.
The resource pack must contain:
* Custom item textures
* Custom models
* Correct item model definitions for the target Minecraft version
* Icons where required
* Optional GUI textures
* Optional NPC/dealer textures if supported
* Optional sounds
* Optional particles where resource-pack support is appropriate
Every custom item must have its own visual identity.
Example:
Soul Reaper:
* Black/purple sword
* Dark glowing effect
* Unique silhouette
Void Heart:
* Black/purple floating heart-like artifact
* Void cracks/glow
Storm Core:
* Blue/white lightning core
Null Fragment:
* Black/white distorted fragment
Do NOT use placeholder textures in the final resource pack.
---
# 17. RESOURCE PACK DELIVERY
The plugin should support:
* Automatic resource-pack hosting if practical.
* Resource-pack URL configuration.
* Resource-pack SHA-1 configuration.
* Prompt player to download.
* Optional force-download mode.
* Resource-pack versioning.
If automatic hosting is not appropriate, provide the exact folder structure and instructions for hosting it.
Do not hard-code an invalid URL.
---
# 18. RESOURCE PACK FALLBACK
If a player does not have the resource pack:
The item must still function correctly.
Use a vanilla fallback item.
For example:
Soul Reaper may visually fall back to a netherite sword.
The internal custom ID must still remain intact.
---
# 19. CUSTOM SOUNDS
Add custom sounds where useful.
Examples:
Soul Reaper:
deep dark activation sound
Void Heart:
void/portal-like sound
Storm Core:
thunder/electric sound
Black Market opening:
dark bell/whisper sound
Legendary purchase:
special confirmation sound
All sounds must be configurable.
---
# 20. PARTICLES
Use Minecraft particles appropriately.
Examples:
* SOUL
* PORTAL
* SMOKE
* END_ROD
* ELECTRIC_SPARK
* ENCHANT
Particles must be optimized.
Do NOT create thousands of particles every tick.
Prevent lag.
---
# 21. BLACK MARKET GUI
The physical dealer must open a clean shop interface.
The GUI should show:
* Item icon
* Item name
* Description
* Rarity
* Price
* Stock
* Restock timer
* Purchase button
Example:
§5☠ SOUL REAPER
§7Legendary Black Market Weapon
§8Ability:
§7Soul Drain
§6Price:
§b10 Diamond Blocks
§8+
§7 45 Netherite Blocks
§cStock: 1/1
§eCLICK TO PURCHASE
The GUI must be configurable.
---
# 22. RESTOCK COUNTDOWN
Show:
"Next restock: 05:43:21"
The countdown must be synchronized with the server's actual restock timestamp.
Do NOT run unnecessary timers for every player.
Optimize the system.
---
# 23. ANNOUNCEMENTS
Optional server announcements:
"§8[§5BLACK MARKET§8] §7The underground market has reopened."
When a Mythic item appears:
"§8[§5BLACK MARKET§8] §dA forbidden artifact has appeared..."
When a unique item is purchased:
"§8[§5BLACK MARKET§8] §cThe Soul Reaper has been claimed."
Make announcements configurable.
---
# 24. ADMIN COMMANDS
Create:
/blackmarket
/blackmarket help
/blackmarket reload
/blackmarket setlocation
/blackmarket adddealer
/blackmarket removedealer
/blackmarket stock
/blackmarket restock
/blackmarket forceopen
/blackmarket forceclose
/blackmarket give -
/blackmarket inspect
-
/blackmarket resetunique
-
/blackmarket debug
/blackmarket resourcepack
Commands must have permissions.
Example:
blackmarket.admin
blackmarket.reload
blackmarket.give
blackmarket.debug
---
# 25. ADMIN GUI
Create an optional admin GUI allowing administrators to:
* View current stock
* Change stock
* Force restock
* Add/remove items
* Change prices
* Change rarity
* Change appearance chance
* Enable/disable items
* Reset unique items
* View transaction history
Do NOT allow ordinary players to access it.
---
# 26. CONFIGURATION
Everything important must be configurable.
Create clean configuration files such as:
config.yml
items.yml
dealers.yml
prices.yml
rarities.yml
messages.yml
resourcepack.yml
database.yml
permissions.yml
Do not put everything into one giant unreadable file.
---
# 27. ITEM CONFIGURATION FORMAT
Make it possible to create new items without changing Java code where practical.
Example:
items:
soul_reaper:
```
name: "&5Soul Reaper"
material: NETHERITE_SWORD
rarity: LEGENDARY
stock: 1
unique: true
price:
DIAMOND_BLOCK: 10
NETHERITE_BLOCK: 45
ability:
type: SOUL_DRAIN
cooldown: 15
resource_pack:
model: "blackmarket:soul_reaper"
```
The actual configuration format can be adapted to the target API.
---
# 28. DATABASE / PERSISTENCE
The following must persist:
* Current Black Market stock
* Current inventory rotation
* Restock timestamp
* Unique item ownership
* Player purchases
* Dealer states
* Secret Dealer state
* Configuration-generated state
Use a reliable persistence system.
For a small SMP, YAML/JSON can be acceptable for simple state.
For transaction history or larger servers, SQLite is preferred.
Never lose Black Market state after restart.
---
# 29. DUPLICATION PROTECTION
Perform extensive anti-duplication testing.
Test:
* Clicking purchase repeatedly
* Shift-clicking
* Double-clicking
* Disconnecting during purchase
* Server restart during purchase
* Inventory full
* Inventory almost full
* Death immediately after purchase
* Two players buying simultaneously
* Last-stock purchase
* Lag
* Plugin reload
* Server crash recovery
If the player's inventory cannot receive the item safely:
DO NOT consume the payment.
---
# 30. INVENTORY FULL PROTECTION
Before accepting payment:
Check whether the purchased item can be safely delivered.
If not:
"§cYour inventory does not have enough space."
Do not take the payment.
---
# 31. WORLD PROTECTION
Abilities must respect:
* WorldGuard if installed
* Spawn protection
* PvP settings
* World borders
* Claims
* Protected regions
If integration is unavailable, provide configuration options.
Never allow a Black Market ability to accidentally grief the server.
---
# 32. PVP SAFETY
All offensive abilities must have configurable PvP behavior.
Example:
pvp-enabled: true
safe-zone-damage: false
friendly-fire: false
The plugin must not bypass existing server protections.
---
# 33. PERFORMANCE
This plugin must be optimized.
Do NOT:
* Run expensive operations every tick unnecessarily.
* Scan every player continuously.
* Spawn huge numbers of particles.
* Create excessive entities.
* Perform blocking database operations on the main server thread.
* Rebuild GUIs unnecessarily.
Use scheduled tasks intelligently.
Cache appropriate data.
Use asynchronous operations where safe.
Never access Bukkit/Paper API asynchronously when the API requires the main thread.
---
# 34. LOGGING
Provide useful logs.
Examples:
[BlackMarket] Loaded 32 custom items.
[BlackMarket] Next restock: 2026-08-29 20:00
[BlackMarket] Player X purchased Soul Reaper.
[BlackMarket] Unique item Soul Reaper is now permanently claimed.
Do NOT spam the console every tick.
---
# 35. ERROR HANDLING
If configuration is invalid:
* Do not crash the server.
* Clearly identify the problem.
* Disable only the affected feature if possible.
* Give a readable error.
Example:
[BlackMarket] ERROR:
Invalid material "DIAMOND_BLOK".
Expected a valid Minecraft material.
---
# 36. RESOURCE PACK VALIDATION
Create a validation system.
When the plugin starts, check:
* Every referenced model exists.
* Every referenced texture exists where applicable.
* Resource-pack configuration is valid.
* Custom item IDs are valid.
* No duplicate IDs exist.
Report errors clearly.
---
# 37. ITEM SECURITY
Players must NOT be able to create legitimate custom items merely by:
* Renaming an item
* Changing lore
* Using an anvil
* Copying an item
* Giving themselves a vanilla item
The plugin must identify custom items using secure internal metadata.
Do not rely solely on:
* Display name
* Lore
* Material
---
# 38. ITEM TRANSFER
Custom items must remain functional when:
* Stored in chests
* Stored in shulkers
* Stored in ender chests
* Dropped
* Picked up
* Traded
* Moved through inventories
If an item is intended to be soulbound, make that configurable.
---
# 39. ITEM DEATH BEHAVIOR
Every custom item must support configurable death behavior:
DROP
KEEP
DESTROY
SOULBOUND
DEFAULT = DROP
---
# 40. BLACK MARKET ECONOMY BALANCE
The prices must be intentionally VERY HIGH.
This is an ENDGAME marketplace.
Example:
Soul Reaper:
10 Diamond Blocks
+
45 Netherite Blocks
Do NOT reduce the price automatically.
Do NOT convert the price to normal economy money.
The administrator must be able to configure every price.
---
# 41. ORE BLOCK VALIDATION
When charging:
10 Diamond Blocks
the plugin must require actual:
minecraft:diamond_block
items.
When charging:
45 Netherite Blocks
the plugin must require actual:
minecraft:netherite_block
items.
Do not accept:
* Diamond items
* Netherite ingots
* renamed blocks
* fake custom blocks
unless explicitly configured.
---
# 42. BLACK MARKET ITEM POOL
Create a configurable item pool.
Example:
COMMON_ITEMS
RARE_ITEMS
LEGENDARY_ITEMS
MYTHIC_ITEMS
FORBIDDEN_ITEMS
SECRET_ITEMS
The restock system chooses from these pools using weighted randomness.
---
# 43. ANTI-EXPLOIT RULES
Prevent:
* Duplication
* Negative stock
* Negative prices
* Invalid item quantities
* NaN values
* Integer overflow
* Race conditions
* GUI spoofing
* Invalid custom item IDs
* Unauthorized commands
* Unauthorized item generation
Validate all user-controlled input.
---
# 44. ADMIN BYPASS
Administrators may have optional bypass permissions.
Example:
blackmarket.admin.bypass
But normal players must NEVER receive admin functionality.
---
# 45. TEST SERVER
Before declaring the plugin complete, perform a complete internal test.
Test:
1. Fresh server
2. Existing world
3. Server restart
4. Plugin reload
5. Two players purchasing simultaneously
6. Last stock purchase
7. Full inventory
8. Disconnect during purchase
9. Invalid configuration
10. Missing resource pack
11. Resource pack accepted
12. Resource pack rejected
13. WorldGuard region
14. PvP disabled
15. PvP enabled
16. Custom item storage
17. Custom item death
18. Custom item transfer
19. Restock
20. Unique item purchase
21. Unique item persistence
22. Server crash recovery
Fix every issue discovered before final delivery.
---
# 46. NO PLACEHOLDERS
Do NOT deliver:
* Pseudocode instead of working code.
* TODO comments for critical systems.
* Fake resource-pack paths.
* Missing configuration files.
* Broken commands.
* Dummy abilities.
* Nonfunctional NPCs.
* Placeholder textures.
* Unimplemented transaction logic.
If something cannot be implemented exactly, clearly state why and provide the closest working implementation.
---
# 47. FINAL PROJECT STRUCTURE
Provide a clean project structure similar to:
src/
├── main/
│ ├── java/
│ │ └── ...
│ └── resources/
│ ├── plugin.yml
│ ├── config.yml
│ ├── items.yml
│ ├── dealers.yml
│ ├── prices.yml
│ ├── rarities.yml
│ ├── messages.yml
│ └── resourcepack.yml
resource-pack/
├── pack.mcmeta
├── assets/
│ └── ...
└── README.md
README.md
---
# 48. DOCUMENTATION
Create a complete README explaining:
* Installation
* Minecraft version
* Server software
* Dependencies
* Commands
* Permissions
* Configuration
* Adding custom items
* Creating dealers
* Changing prices
* Changing restock times
* Resource-pack installation
* Resource-pack hosting
* Troubleshooting
* Backup/recovery
* Admin usage
Explain everything clearly enough that someone who has never developed a Minecraft plugin can configure it.
---
# 49. IMPORTANT DEVELOPMENT RULE
Before coding, inspect the project.
Understand:
* Existing files
* Existing plugin architecture
* Minecraft version
* Java version
* Dependencies
* Existing commands
* Existing resource pack
* Existing custom item systems
DO NOT overwrite existing systems blindly.
If my server already has another SMP/score plugin, make this Black Market plugin independent unless integration is specifically requested.
---
# 50. OPTIONAL SCORE SMP INTEGRATION
If the existing Score SMP plugin exposes an API, create an OPTIONAL integration.
The Black Market should be able to optionally require a minimum score.
Example:
Soul Reaper:
minimum-score: 5000
If the Score SMP plugin is unavailable:
The Black Market must still work normally.
Do not make the Black Market unusable simply because the Score SMP plugin is missing.
---
# 51. FINAL QUALITY REQUIREMENT
Treat this as a REAL production plugin, not a demonstration.
Every system must be:
* Stable
* Configurable
* Persistent
* Exploit-resistant
* Multiplayer-safe
* Performance-conscious
* Compatible with the target Minecraft version
* Fully documented
* Visually polished
Before finalizing, perform a complete consistency check.
Verify that:
1. Every command exists.
2. Every permission exists.
3. Every configuration key used by code exists.
4. Every item ID exists.
5. Every resource-pack model referenced exists.
6. Every ability referenced exists.
7. Every dealer ID exists.
8. Every price is valid.
9. Every restock system persists.
10. Every unique item persists.
11. Every purchase is atomic.
12. No critical TODO remains.
13. No placeholder asset remains.
14. No duplicate custom IDs exist.
15. The plugin compiles successfully.
16. The resource pack builds successfully.
17. The plugin loads without errors.
18. The Black Market works after a complete server restart.
DO NOT declare the project finished until all of these checks pass.
The final result should feel like a **secret, extremely expensive, underground Minecraft contraband market** where players can discover items that are completely unique to this SMP.
The strongest items should require absurd amounts of resources such as:
10 Diamond Blocks + 45 Netherite Blocks
and even more for Mythic/Secret items.
The Black Market should become one of the most prestigious destinations on the server.
I’ll create the project as a Paper 1.20.6 / Java 21 plugin with:
Persistent rotating stock, weighted rarity selection, physical-item atomic payments, and unique-item claims.
Villager dealers, protected interactions, player GUI, operating hours, restock countdown, and admin commands.
Secure PDC-backed custom items with configurable example abilities and cooldowns.
Split YAML configuration, state persistence, resource-pack delivery/validation, and setup documentation.
Created a Paper 1.20.6 / Java 21 Black Market plugin with:
Persistent weighted rotations and restock countdowns.
Physical diamond/netherite block payments.
Atomic, locked purchases with stock and inventory-space validation.
Unique item claims persisted in
state.yml.Protected villager dealers with configurable locations and permissions.
Configurable opening hours and force-open/force-close controls.
PDC-secured custom item IDs.
Soul Reaper, Void Heart, Storm Core, Blood Contract, Eye of the Void, Fallen Wings, and Null Fragment examples.
Admin commands for reload, dealers, stock, restocking, giving items, inspecting items, and resetting unique claims.
Added split configuration files:
config.ymlitems.ymldealers.ymlrarities.ymlprices.ymlmessages.ymlresourcepack.ymldatabase.yml
Added a functional resource-pack model-routing structure with safe vanilla texture fallbacks and documentation for hosting it.
Added installation, configuration, command, recovery, and resource-pack documentation in
README.md.
The project is pinned to Paper 1.20.6-R0.1-SNAPSHOT, Java 21, and XSeries 11.2.0.1. Custom binary PNG artwork is not embedded because the project was generated through text-only file operations; the included pack remains functional using vanilla texture references.
package com.kodari.blackmarket;
import com.kodari.blackmarket.ability.AbilityListener;
import com.kodari.blackmarket.command.BlackMarketCommand;
import com.kodari.blackmarket.config.ConfigRepository;
import com.kodari.blackmarket.dealer.DealerManager;
import com.kodari.blackmarket.gui.MarketGUI;
import com.kodari.blackmarket.item.ItemFactory;
import com.kodari.blackmarket.market.MarketManager;
import com.kodari.blackmarket.persistence.StateStore;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public final class BlackMarketPlugin extends JavaPlugin implements Listener {
private ConfigRepository config;
private StateStore state;
private ItemFactory items;
private MarketManager market;
private MarketGUI gui;
private DealerManager dealers;
@Override
public void onEnable() {
saveDefaultConfig();
for (String file : new String[]{"items.yml", "dealers.yml", "rarities.yml", "prices.yml", "messages.yml", "resourcepack.yml", "database.yml"}) saveResource(file, false);
config = new ConfigRepository(this);
state = new StateStore(this);
items = new ItemFactory(this);
market = new MarketManager(config, state, items);
gui = new MarketGUI(this, config, market, items);
dealers = new DealerManager(this, config, market, gui);
dealers.reload();
Bukkit.getPluginManager().registerEvents(this, this);
Bukkit.getPluginManager().registerEvents(gui, this);
Bukkit.getPluginManager().registerEvents(dealers, this);
Bukkit.getPluginManager().registerEvents(new AbilityListener(this, config, market, items), this);
BlackMarketCommand command = new BlackMarketCommand(this, config, market, dealers, items);
getCommand("blackmarket").setExecutor(command);
getCommand("blackmarket").setTabCompleter(command);
Bukkit.getScheduler().runTaskTimer(this, () -> {
if (market.nextRestock() <= System.currentTimeMillis()) market.restock(true);
}, 1200L, 1200L);
getLogger().info("Loaded " + market.itemMap().size() + " custom Black Market items.");
}
@EventHandler
public void join(PlayerJoinEvent event) {
if (!config.resourcePack().getBoolean("enabled", false)) return;
String url = config.resourcePack().getString("url", "");
if (url.isBlank()) return;
Bukkit.getScheduler().runTaskLater(this, () -> {
Player player = event.getPlayer();
if (player.isOnline()) player.setResourcePack(url);
}, 20L);
}
}