Shops: Difference between revisions

From Citizens Wiki

No edit summary
No edit summary
Line 1: Line 1:
Citizens has added support for basic GUI shops.
Citizens has built-in support for basic GUI shops.


== Getting Started ==
== Getting Started ==
Line 8: Line 8:


Here you can see the settings screen from left to right:
Here you can see the settings screen from left to right:
[[File:Shop Settings.png|thumb]]
[[File:Shop Settings.png|frameless]]


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).
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).
Line 14: Line 14:
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!
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!


[[File:Edit Shop Screen.png|thumb]]
[[File:Edit Shop Screen.png|frameless]]


== Editing pages ==
== Editing pages ==
Line 28: Line 28:
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.
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.


[[File:Edit Item Screen.png|thumb]]
[[File:Edit Item Screen.png|frameless]]


There's some buttons at the bottom to edit various things like purchase message, click to confirm, max purchases etc.  
There's some buttons at the bottom to edit various things like purchase message, click to confirm, max purchases etc.  
Line 37: Line 37:
First, I click on the item cost chest button at the top left.
First, I click on the item cost chest button at the top left.


[[File:Item Cost .png|thumb]]
[[File:Item Cost .png|frameless]]


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.
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.


[[File:Item Result preview.png|thumb]]
[[File:Item Result preview.png|frameless]]
[[File:Item Display Preview.png|thumb]]
[[File:Item Display Preview.png|frameless]]


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


[[File:Shop Show on right click.png|thumb]]
[[File:Shop Show on right click.png|frameless]]


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


[[File:Shop Result 1.png|thumb]]
[[File:Shop Result 1.png|frameless]]
[[File:Shop Result 2.png|thumb]]
[[File:Shop Result 2.png|frameless]]


== Changing the shop type ==
== Changing the shop type ==
Line 58: Line 58:
Using the above demo, let's see what the trader shop looks like. First, I set the shop to a trader shop.
Using the above demo, let's see what the trader shop looks like. First, I set the shop to a trader shop.


[[File:Shop type set.png|thumb]]
[[File:Shop type set.png|frameless]]


Now we can see the final result.  
Now we can see the final result.  


[[File:Trader shop.png|thumb]]
[[File:Trader shop.png|frameless]]


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

Revision as of 11:54, 2 November 2024

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.