MerchantMind_v1.7.1.mcaddon
What's new
πͺ Merchant Mind v1.7.1
Minecraft Bedrock Edition Port
Major shop-system expansion with dynamic stock, quantity-based purchasing, quantity-aware packaging and delivery, improved restock notifications, reservation stock validation, and payment/UI bug fixes.
π Highlights
- π¦ Added per-item stock quantities to shop slots.
- π² Added randomized stock quantities during restock.
- π Added quantity-based direct purchases.
- ποΈ Added quantity selection before purchasing.
- π° Purchase totals now use
unit price Γ quantity. - π¦ Packaging now tracks the quantity purchased.
- π Package delivery now delivers the complete purchased quantity.
- π Remaining shop stock is preserved after purchases.
- π Improved automatic restock synchronization and notifications.
- π¬ Added grouped notifications when all categories restock together.
- β¨οΈ Restored and hardened
/mtxt:restock_setcommand registration. - π‘οΈ Added additional payment, stock, and delivery safety checks.
β¨ Added
π¦ Dynamic Item Stock
- Every available shop slot now has its own stock quantity.
- Stock is generated independently for each shop item during restock.
- Stock quantities are randomized instead of always representing a single item.
- Stock amount is balanced using the item's internal
WORTHprice. - Stock is capped by the item's maximum stack size.
- Added stock-aware slot states.
- Added migration support for existing shop data that does not contain stock information.
π² Stock Generation
Stock ranges are based on the item's price:
| Item Price | Random Stock |
|---|---|
< 20 |
4β8 |
< 50 |
3β6 |
< 100 |
2β5 |
< 250 |
2β4 |
< 600 |
1β3 |
< 1000 |
1β2 |
>= 1000 |
1 |
- Generated stock is additionally limited by the item's maximum stack size.
- Stock is never generated below
1for an available item.
π Quantity-Based Purchases
ποΈ Direct Buy
Available items no longer immediately enter the old one-item payment flow.
New flow
Buy
β
Select Quantity
β
Submit Purchase
β
Validate Stock
β
Validate Coins
β
Deduct Total Price
β
Start Packaging
β
Deliver Purchased Quantity
- Added quantity selection for direct purchases.
- Added a quantity slider for items with multiple units in stock.
- Added
Submit Purchase. - Quantity selection always starts at a minimum of
1. - The latest stock value is checked again when the purchase is submitted.
- Players cannot purchase more than the current remaining stock.
π° Purchase Calculation
Purchase cost is now calculated as:
Total Price = Unit Price Γ Quantity
Example:
Diamond
Price: 100 coins each
Quantity: 3
100 Γ 3 = 300 coins
The player is charged the actual total price for the selected quantity.
π Shop Stock Display
Shop slots now display their current inventory state.
Available
Diamond
Stock: 5
Price: 100 coins each
Out of Stock
Diamond
Out of stock
Packaging
Diamond
Packaging x3...
- Added stock information directly to shop entries.
- Available-item counting now ignores slots with
0stock. - Out-of-stock items can no longer be purchased.
π¦ Packaging System
- Packaging now records the quantity purchased.
- Direct purchases now enter the packaging system after successful payment.
- Reserved purchases continue to use the existing packaging process.
- Installment purchases continue to use the existing packaging process.
- Packaging quantity is preserved throughout the entire packaging period.
- Packaging progress now includes the quantity being packaged.
Example:
Packaging diamond: 7s remaining (3x).
π Quantity-Aware Delivery
- Completed packages now deliver the full purchased quantity.
- Delivery no longer assumes every package contains exactly
1item. - Items are automatically split into valid stacks according to the item's maximum stack size.
Example:
Purchase:
130 Stone
Delivery:
64 Stone
64 Stone
2 Stone
- Delivery is only marked complete after the item delivery operation succeeds.
- If delivery fails, the package remains in the packaging state and can be retried.
- Successful delivery restores the shop slot to:
availablewhen stock remainssoldwhen stock reaches0
π Remaining Stock
Purchasing an item now consumes the selected quantity from the shop stock.
Example:
Initial stock:
5
Purchase:
2
Remaining stock:
3
After packaging completes:
Stock > 0
β available
When the final items are purchased:
Stock = 0
β sold
This prevents a partially purchased slot from incorrectly becoming permanently sold.
π Restock System
- Restocking now generates new randomized stock for refreshed slots.
- Reserved items remain protected during restock.
- Items currently being packaged remain protected during restock.
- Existing active reservations are not overwritten by a normal restock.
- Existing active packaging operations are not overwritten by a normal restock.
- Restock processing was reorganized so multiple categories can be evaluated together.
π¬ Restock Notifications
Individual Category Restock
When categories restock independently, notifications continue to identify the affected category.
Example:
Weapon auto restock started (5s).
and:
Weapon Auto restock completed. Next auto restock in 1m 10s.
π All Categories Restocking Together
When all categories begin automatic restocking together, the categories are combined into one message instead of generating one message per category.
All categories are now restocking (5s).
β All Categories Finished Together
When all categories complete automatic restocking together, they are combined into one completion message.
All categories restock completed. Next auto restock in 1m 10s.
- Added grouped completion handling.
- Added next-restock countdown information to the grouped completion message.
β¨οΈ /mtxt:restock_set
The existing custom command remains available.
/mtxt:restock_set <second> [minute] [hours]
Examples:
/mtxt:restock_set 30
/mtxt:restock_set 10 30
/mtxt:restock_set 0 0 1
Command changes
- Restored the required Custom Command API imports.
- Updated the callback to read command parameters from the command argument array.
- Added safety handling around command registration.
- A command-registration failure is prevented from terminating the entire Merchant Mind script initialization.
π³ Payment & Reservation Improvements
π Stock Validation
Reserved and installment purchases now verify that the item still has stock before payment processing continues.
- Full payment checks current stock.
- Installment payment checks current stock.
- Final installment completion consumes the reserved item's stock.
- An item with no remaining stock cannot proceed to final payment.
π° Payment Safety
Payment operations now use stronger state protection.
- Payment state is preserved before modifying shop data.
- If saving the updated shop state fails after charging the player, the payment is refunded.
- Installment payments use the same rollback protection.
- Failed payment operations no longer intentionally leave the player charged.
π₯οΈ Purchase & Payment UI
π Direct Purchase UI
Direct purchases now use a quantity-selection interface instead of immediately attempting payment.
For multiple-stock items:
Buy Diamond
Stock: 5
Price: 100 coins each
Total: price Γ quantity
Balance: 500
Quantity:
[βββββββββββββ]
[Submit Purchase]
For an item with exactly one item remaining, the interface avoids an invalid 0β1 quantity slider and instead provides a direct one-item purchase action.
Buy Diamond
Stock: 1
Price: 100 coins
Total: 100 coins
Balance: 500
[Buy 1 (100 coins)]
[Back]
π Bug Fixes
Fixed: Invalid 0 Quantity for Single-Stock Items
- Fixed the quantity-selection logic that could allow a quantity of
0when only one item remained in stock. - Prevented the resulting:
Select at least 1 item to purchase.
error from appearing when attempting to buy a single remaining item.
- Single-stock purchases now directly use quantity
1.
Fixed: Misleading Payment Error Interface
Previously, some validation failures were shown through a payment-error dialog even when the problem was not actually a payment failure.
The purchase system now distinguishes between:
Purchase Error
and:
Payment Error
- Direct-purchase validation failures now use
Purchase Error. - Actual reservation/installment payment failures continue to use
Payment Error.
Fixed: Blank Second Button in Error Dialogs
- Replaced the two-button payment error dialog with a single-button error dialog where appropriate.
- Error dialogs now display a single usable button:
[OK]
- Removed the empty/unused second button that could appear underneath the
OKbutton.
Fixed: Payment Rollback Safety
- Full payments now restore the player's coins if saving the updated shop state fails.
- Installment payments now restore the player's coins if saving the updated reservation state fails.
- Failed payment operations now report that any charge was refunded.
Fixed: Delivery State Handling
- Failed package delivery no longer immediately marks the package as delivered.
- Packages that cannot be delivered remain available for retry.
- Successful deliveries correctly clean up the package state.
Fixed: Remaining Stock After Packaging
- A package completion no longer automatically marks the shop slot as
sold. - Slots with remaining stock correctly return to
available. - Slots with zero remaining stock correctly become
sold.
π§³ Existing Save Compatibility
- Existing shop saves remain usable with the new stock system.
- Slots without stock information are automatically normalized.
- Existing sold slots receive
0stock. - Existing available slots receive a valid stock value.
- Existing packaging slots receive a valid quantity value when required.
- Existing reservation and packaging states remain protected during restock.
π’ Version
Current Release
Merchant Mind: 1.7.1
Behavior Pack
1.7.1
Resource Pack
1.7.1
BP β RP Dependency
1.7.1
π Unchanged Systems
The following systems remain part of Merchant Mind and were not removed by the 1.7.x shop upgrade:
- Reservation system
- 15-minute reservation deadline
- Reservation expiration warnings
- Installment payments
- Per-world isolated economies
- Smart Selling
- Dirt selling override
- Slam Charge
- Mob Suppression
- Item Clearing
- Manual Restock
- Iron Instant Restock
- Live Shop UI refresh
- Combat adjustments
π§© API / Manifest
The following manifest values remain unchanged:
@minecraft/server
2.10.0
@minecraft/server-ui
2.2.0
Minimum Minecraft Version
1.26.50
Only the Merchant Mind pack/release version values were advanced to:
1.7.1
π Version Summary
v1.6.6
β
ββ Original shop / economy system
β
βΌ
v1.7.1
β
ββ π¦ Dynamic per-item stock
ββ π² Randomized stock quantities
ββ ποΈ Quantity-based direct purchases
ββ π° Price Γ quantity payment
ββ π¦ Quantity-aware packaging
ββ π Quantity-aware delivery
ββ π Remaining-stock tracking
ββ π Improved synchronized restocking
ββ π¬ Grouped restock notifications
ββ β¨οΈ Restored /mtxt:restock_set registration
ββ π‘οΈ Payment rollback protection
ββ π Fixed invalid quantity = 0 purchase flow
ββ π Fixed misleading Payment Error usage
ββ π Fixed blank secondary error button
ββ π Fixed delivery retry handling
ββ π Fixed remaining-stock slot state
π― Merchant Mind v1.7.1
Smarter stock. Better purchasing. Real quantity-based delivery. Safer payments. Cleaner restocking.
This mod has no additional files

