How can I create a shop with currency in Minecraft, using the scoreboard command? [duplicate]

How can I create a shop with currency in Minecraft, using the scoreboard command? [duplicate] - Crop happy female in apron smiling and using grinder for preparing aromatic coffee in kitchen

I previously knew how to make a shop using command blocks pre MC 1.13 before they changed a bunch of commands. I know the basics of /scoreboard and other commands but I'm really lost on this.

I would like to be able to add money to players, remove money, and allow buying and selling with command blocks. Preferably I'd like players to not go negative when buying.



Best Answer

First, create an objective to track their money value with:

scoreboard objectives add money dummy Money

In the command above, dummy simply means that the objective is only updated by commands. Next, add a player to the newly created objective:

scoreboard players set @s money 100

Here, I'm adding myself to the money objective with an initial score of 100. So I initially have, let's say $100. Alternatively, you can use a single command to set the initial value for all players with:

scoreboard players set * money 100

Now, for purchases and sales, you can use the add and remove arguments:

scoreboard players add @s money 10
scoreboard players remove @s money 10

All of the above can be chained together using command blocks to create your store. Of course, you'll need to integrate commands like give into the mix, for example:

scoreboard players remove @p money 10
give @p minecraft:concrete



Pictures about "How can I create a shop with currency in Minecraft, using the scoreboard command? [duplicate]"

How can I create a shop with currency in Minecraft, using the scoreboard command? [duplicate] - Rolls of assorted fabrics and textiles and sewing patterns inside tailor atelier
How can I create a shop with currency in Minecraft, using the scoreboard command? [duplicate] - Crop young businesswoman using laptop while drinking tea at home
How can I create a shop with currency in Minecraft, using the scoreboard command? [duplicate] - Close-up Photography Two Brown Cards



How do you make a shop in Minecraft using commands?

Open the inventory. Click on the item you want to duplicate to pick it up. Hold your mouse's scroll wheel button and drag it over empty inventory slots to duplicate it as stacks in your inventory.

How do you add money to your scoreboard in Minecraft?

In order to set up a shop, you must first start by placing a chest, trapped chest, shulker box or barrel somewhere. This chest should contain the item(s) you would like to sell (or it will store any items you may be buying). Then, you need to place a sign near the chest - the shop sign.



Minecraft Money Scoreboard Tutorial - Working Currency system and Shop




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Tim Douglas, Ksenia Chernaya, Vlada Karpovich, Pixabay