[Tip] Create an automated shop in Minecraft

Any server with an economy, regardless of its type, is based on shops that provide exchanges between players or with an independent system. And it is precisely on this criterion of the interlocutor that we can distinguish between two types of shops: those that allow two players to exchange between them, which is similar to a sales hotel, and those that allow the purchase of items potentially infinite to an independent entity, for example a merchant NPC. This is the second case that will interest us today. In this article, we will learn how to create a simple shop, both in its configuration and in its interface, which comes down to a simple panel.
Set up your shop


Here is a preview of the shop you are going to create. It consists of a panel on which are indicated on the left the item and the quantity you give in, the item and the quantity you receive will be indicated on the right..
To start, get a command block and enter the following command:

/ give @p sign 1 0 {BlockEntityTag: {Text1: “{\” text \ “: \” You Pay You Get \ “, \” italic \ “: true, \” clickEvent \ “: {\” action \ ” : \ “Run_command \”, \ “value \”: “scoreboard players set @p SHOP [number of your shop] \”}} “, Text2:” {\ “text \”: \ “[number of items given] x [number of items received] x \ “, \” bold \ “: true, \” color \ “: \” white \ “, \” clickEvent \ “: {\” action \ “: \” run_command \ “, \” Value \ “: \” / playsound ui.button.click master @a [r = 10] ~ ~ ~ .4 1.7 \ “}}”}, display: {Name: “Custom Sign”}}

If you make several shops on the same map, the “number of your shop” part will allow the following commands to differentiate them.

Then, feed the command block in redstone. As long as it is powered, any sign that you ask will turn into a shop. For now, the panels will display the quantities of items exchanged, but not the items themselves. To remedy this, you will need two commands, one for each item or block of the panel. Depending on whether the object in question is a block or an item, the orders are different.

If the given object is a block
/ summon armor_stand ~ .58 ~ .5 ~ .31
{CustomName: “ASITM”, NoGravity: 1b, Small: 1, Invisible: 1, HandItems: [{id: [block id], Count: 1b}, {} ] Exposure: {RightArm: [- 15f, 45f, 0f]}, DisabledSlots: 2039583, Marker: 1}

If the given object is an item
/ summon armor_stand ~ .45 ~ .08 ~ .1
{CustomName: “ASITM”, NoGravity: 1b, Small: 1, Invisible: 1, HandItems: [{id: [item id], Count: 1b}, {}] Pose: {RightArm: [- 90f, 0f, 0f]}, DisabledSlots: 2039583, Marker: 1}

If the received object is a block
/ summon armor_stand ~ .08 ~ .5 ~ .31
{CustomName: “ASITM”, NoGravity: 1b, Small: 1, Invisible: 1, HandItems: [{id: [block id], Count: 1b}, {} ] Exposure: {RightArm: [- 15f, 45f, 0f]}, DisabledSlots: 2039583, Marker: 1}

If the object received is an item
/ summon armor_stand ~ -.06 ~ .08 ~ .1
{CustomName: “ASITM”, NoGravity: 1b, Small: 1, Invisible: 1, HandItems: [{id: [item id], Count: 1b} {}], Pose: {RightArm: [- 90f, 0f, 0f]}, DisabledSlots: 2039583, Marker: 1}

Place these commands in command blocks just below your shop, and place it first looking south. Activate it with a button, then destroy it and repeat the operation with the second one (there is no order between them).

All that remains is to configure the system itself. For that, you will have to bring four command blocks which you will have to place in column like this:

On this screenshot, they are on the right, the other command blocks containing the previously indicated commands.

From the bottom up, here is the configuration of each command block

  • Repeat, Unconditional, Always active;
  • Chain, Unconditional, Always active;
  • Chain, Conditional, Always Active;
  • Chain, Unconditional, Always active.

From the bottom up, here are the commands to put in each command block:

/ scoreboard objectives add SHOP dummy

/ Clear @a [score_SHOP_min = [number of your shop], score_SHOP = [number of your store]] [id of the given object] 0 [quantity given]

/ Give @a [SHOP score_min = [shop number], SHOP_score = [store number]] [received item ID] [received quantity]

/ Scoreboard players reset @a [score_SHOP_min = 1] SHOP

If you have several shops at the same time, leave the first three command blocks as they are, and add two new command blocks on top of the second and third command block models. Finally, place over the last last command block.

Due to a problem with fulfillment of command block conditions, a player may obtain the item (s) from the shop by giving only one item, even if more than one item is required. It is therefore recommended to create exchanges costing only one object.

The post [Tip] Create an automated shop in Minecraft appeared first on Minecraft Download Free.

Previous
Next Post »