Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
Changelog
Shopkeeper Guide
The Shopkeeper role in the Shop 'n Trade datapack allows players to create, manage, and maintain in-game shops efficiently. This guide provides detailed information on how to perform key actions, including setting up and managing shops, collecting profits, and handling inventory.
Shop Creation and Setup
Shops are automatically created when a player interacts with a sign placed on a chest, barrel, or shulker box. The sign must include the shop owner's name, the quantity of items available, and the pricing details. The item to be sold is determined based on the contents of the shop container, eliminating the need for manual item setup and simplifying the shop creation process.
When you walk into the sign, the system automatically detects and sets up the shop based on these details and the container's contents.
Sign format
1 | In-game username | Must be spelled exactly correctly. |
---|---|---|
2 | Amount | Number of items sold per batch; must strictly be a number on this line. |
3 | Item | The item sold is written on the sign automatically, make sure to have items in the shop first. |
4 | Price | The format of the price can be pretty loose, line must start with a number and then any letters can come after that. 0 means it's free. |
Example:
Managing the Shop
Once the shop is set up, the shopkeeper can manage it using a series of clicks on the shop sign. The first click on the shop sign unlocks the shop, allowing the shopkeeper to access and manage the inventory and settings. While the shop is unlocked, if any items in the container are changed, the shop automatically updates to reflect the new items. This feature ensures that the shop’s inventory remains accurate without requiring the shopkeeper to manually update the shop.
The second click on the shop sign allows the shopkeeper to collect profits and any waste items, which are items not intended for sale. This double-click mechanism simplifies the process of managing the shop’s earnings.
After collecting profits and managing the inventory, the shop can be relocked with a third click on the sign, which secures the shop from unauthorized access. The shop also automatically relocks when the shopkeeper leaves the area, further enhancing security.
Shop Maintenance and Notifications
Maintaining a shop involves regularly restocking items to ensure continuous operation. When the shop is unlocked, the shopkeeper can add new items to the container. If the stocked item in a shop's inventory is changed while the shop is unlocked, the system automatically updates the shop with the new item, ensuring the shop's inventory remains accurate.
If the shop runs out of stock, the buyer is notified. The system alerts the shopkeeper when they are online and not AFK. This notification feature is crucial for keeping the shop operational and ensuring that customers always have access to the items they wish to purchase.
Automated and Improved Systems
The datapack includes several automated systems designed to reduce manual intervention and improve shop management. Shops are created and updated automatically based on the items in the container, simplifying the process. The system also includes robust algorithms for validating items and stock levels, which automatically flag any invalid entries and put them in waste storage. A strict NBT data check is included in this validation. This ensures that shops operate smoothly and accurately.
Buying
Purchasing items is streamlined through a right-click purchase mechanism, where players can buy items by right-clicking the shop sign. If the item being sold contains additional NBT data, such as enchantments or nested items within a shulker box, the system provides a confirmation message with detailed information before completing the transaction, or cancelling it when the buyer moves away. This ensures that items with NBT data are accurately detected and processed, resulting in a reliable and transparent transaction experience. The NBT data should be intuitive to read, with a little critical thinking, but again, invalid entries are filtered out.
Security and Anti-Griefing Measures
To prevent griefing, players near a shop are automatically placed in Adventure mode, which prevents them from breaking or interacting with the shop in unintended ways. If a player becomes trapped due to this feature, they can escape using the /trigger trapped_in_shop
command. Shops are locked by default to prevent unauthorized access. When a shop owner clicks on their shop sign, the shop unlocks, allowing them to manage the shop in the ways detailed earlier.
Files
Metadata
Release channel
BetaVersion number
2Loaders
Game versions
1.21–1.21.1Downloads
9Publication date
August 23, 2024 at 3:18 PMPublisher
TQNL
Owner