Shops

From Citizens Wiki

Revision as of 11:56, 2 November 2024 by Fullwall (talk | contribs)

Citizens has built-in support for basic GUI shops.

Getting Started

Type /npc shop edit to open the NPC's shop. You can also create a named shop by typing /npc shop edit NAMEHERE. Named shops can be shared by any NPC.

You will see basic configuration settings including editing the type of shop from buy to sell to command shops, setting the permission required to view the shop, and whether to open the shop on right click.

Here you can see the settings screen from left to right: Shop Settings.png

You can edit the permission required to view the shop, the shop items, the shop title, whether to open this shop on right click and the type of shop (explained later).

After clicking on the edit shop button for example you can see the following screen. Edit the shop title in the anvil menu and click on the paper to change the title!

Edit Shop Screen.png

Editing pages

You probably want to create a shop page. Click on the feather icon to start editing individual pages.

In this screen, you can drop an item onto the page slots to put it into the shop.

Edit Shop Items.png

This will be the item that's displayed in your shop. You can also edit the next page slots by using shift-click.

Editing items

Once in the editing item screen, you can set a cost (on the top left) and a result (on the top right). Note that a result item must be set or else the item will just sit in the shop looking pretty.


Edit Item Screen.png

There's some buttons at the bottom to edit various things like purchase message, click to confirm, max purchases etc. Please note: the green emerald block must be clicked to save the item when you're done.

Next, let's add a cost and a result. I have some sand and I want to set up a trade from one sand to three sticks.

First, I click on the item cost chest button at the top left.

Item Cost .png

Just drag and drop an item anywhere in the top screen to set it as a cost. I do the same thing for the item result (3 sticks). You can see the preview of the cost and result by hovering over the icons.

Item Result preview.png Item Display Preview.png

I also set the shop to show on right click using the following setting.

Shop Show on right click.png

Here's the final resulting shop and I can easily trade for some sticks.

Shop Result 1.png Shop Result 2.png

Changing the shop type

You can change the shop type in the shop settings. Currently, this lets you change the number of chest rows your shop will show and also make it into a trader shop i.e. display as a villager trader GUI.

Using the above demo, let's see what the trader shop looks like. First, I set the shop to a trader shop.

Shop type set.png

Now we can see the final result.

Trader shop.png

Note that the result of the trade is shown as the display item, not the stick result.

Advanced topics

There are a lot more advanced topics within the shop GUI. If you would like more info here, please ask on Discord to get it added.