How To Create A Shop That Uses Experience As The Money
In Vanilla Minecraft!
This post will show you how to make awesome player shops for servers or adventure maps! The shop system requires NO MODS and uses command blocks. The currency for the shop is the player's LEVEL of EXPERIENCE. Enjoy
Each shop uses 2 command blocks and 2 redstone repeaters. Here's some pictures of what it looks like:
As you can see, they are very compact. So, lets say you want a shop that allows a player to buy a diamond sword for 5 levels of xp. Here's what you would put in the first command block.
First Command Block:
The command block that gives the item.
give - This is the command that gives items to players.
@p - This means the command will interact with the player CLOSEST to the command block. (@a means ALL players and @r picks a random player)
[lm=5] - When you add [lm=5] next to @p it creates a conditioner. lm stands for 'level minimum' so the command block will only give the closest player a diamond sword IF he/she has a minimum level of 5.
276 - This is the item ID for diamond sword. Change this to whatever you want the item to be.
1 - This is the amount of items that will be distributed to the player.
Entering give @p[lm=5] 276 1 in a command block means that, when the command block is powered, if the CLOSEST player to the command block has AT LEAST 5 levels of xp they will receive 1 diamond sword.
Second Command Block:
The command block that removes xp from the player.
xp - the command that can remove or add experience or experience levels to a player or players.
-5l - Putting a - means that you are going to REMOVE experience from the player, 5 is the amount, and adding an l to the end changes it to the LEVEL of experience.
@p - This means the command will interact with the player CLOSEST to the command block. (@a means ALL players and @r picks a random player)
[lm=5] - When you add [lm=5] next to @p it creates a conditioner. lm stands for 'level minimum' so the command block will only remove 5 exp levels from the closest player IF he/she has a minimum level of 5.
Entering xp -5l @p[lm=5] in a command block means that, when the command block is powered, 5 levels of exp will be REMOVED from the CLOSEST player IF they have AT LEAST 5 levels.
This shop concept is GREAT for adventure maps and could also be used on servers. If you want to see some examples of this shop being used, download one of my maps and the shops are incorporated in the maps.
Just a note, in some cases this will fail - the reason some shops teleport - if another player comes closer, i.e., it will take the XP from them, while giving the diamond sword to the other player.. To fix this you could just have a iron door with pressure plate style room for it.
Just a note, in some cases this will fail - the reason some shops teleport - if another player comes closer, i.e., it will take the XP from them, while giving the diamond sword to the other player.. To fix this you could just have a iron door with pressure plate style room for it.
Easy fix.
(The design on the right)
This fixes the issue because both command blocks are activated at the same time.
The only drawback of this is that it is not as compact as the original design.
Dude, thank you so much. I'm working on a minigame right now, Ghast Sniper, and this is exactly what i was looking for. I'll give you credit for help in the credits of the map. Cheers.
Dude, thank you so much. I'm working on a minigame right now, Ghast Sniper, and this is exactly what i was looking for. I'll give you credit for help in the credits of the map. Cheers.
Hey no problem man, I also know how to make objectives shops. If you need help with that let me know!
There's a serious issue with this. On a multiplayer server, if the player doesn't have the necessary XP, the nearest player who does will get the item and lose their XP. You can fix this by adding a short radius to the @p.
Cool. But could someone show me how to make them spend items? Something like 1 diamond sword for 40 emeralds.
P.S. This was awesome so im book marking it!
Cool. But could someone show me how to make them spend items? Something like 1 diamond sword for 40 emeralds.
P.S. This was awesome so im book marking it!
To do this you would have to make a hopper shop which is very complex. Or, if you have mcedit, just make a custom villager and customize that trade. You can even make the villager invincible so players can't kill him.
There's a serious issue with this. On a multiplayer server, if the player doesn't have the necessary XP, the nearest player who does will get the item and lose their XP. You can fix this by adding a short radius to the @p.
How do you do this and what does it mean. Could you post a screen shot?
I have some of these and I have a few screenshots to show you. (lets hope I can get the pictures working)
A more compact version of your design.
Same design, but I changed some text. First, I used a radius (r=15) so that it will not look for any players that meet the qualification. Next I used a different money. I made a Points objective using the new scoreboard system (you must type "/scoreboard objectives add Points totalKillCount (replace totalKillCount with list to see the other kinds of objectives) Points" and then it will count every kill you get) and used that as my score, then removed points from it.
This is a way to sell items using command blocks. The comparator will only send a signal if the first command run. The repeaters on the side resets the comparator to the off state. Change some things and play around with this to understand it better if you don't understand what I did.
Note: I didn't use any specifiers on the sell shop, but you can use them and you can make the diamond sword give you points on a scoreboard objective also (you just need to change the second command block to say "/scoreboard players add @p Points 5" (or however many points you want)). Also sorry if the pictures don't work.
Edit: doesn't look like they worked could you tell me what I did wrong so I can fix them?
Edit: Thanks for your help, and I hope someone learns something from my screenshots.
I have some of these and I have a few screenshots to show you. (lets hope I can get the pictures working)
A more compact version of
Same design, but I changed some text. First, I used a radius (r=15) so that it will not look for any players that meet the qualification. Next I used a different money. I made a Points objective using the new scoreboard system (you must type "/scoreboard objectives add Points totalKillCount (replace totalKillCount with list to see the other kinds of objectives) Points" and then it will count every kill you get) and used that as my score, then removed points from it.
This is a way to sell items using command blocks. The comparator will only send a signal if the first command run. The repeaters on the side resets the comparator to the off state. Change some things and play around with this to understand it better if you don't understand what I did.
Note: I didn't use any specifiers on the sell shop, but you can use them and you can make the diamond sword give you points on a scoreboard objective also (you just need to change the second command block to say "/scoreboard players add @p Points 5" (or however many points you want)). Also sorry if the pictures don't work.
Edit: doesn't look like they worked could you tell me what I did wrong so I can fix them?
Yes upload your images at imgur.com. Then copy the BBC code and they will work. And yes you can make a shop system uses scoreboard objectives. I used that in my Zombie Arena 3 mini game.
Each shop uses 2 command blocks and 2 redstone repeaters. Here's some pictures of what it looks like:
As you can see, they are very compact. So, lets say you want a shop that allows a player to buy a diamond sword for 5 levels of xp. Here's what you would put in the first command block.
First Command Block:
The command block that gives the item.
give - This is the command that gives items to players.
@p - This means the command will interact with the player CLOSEST to the command block. (@a means ALL players and @r picks a random player)
[lm=5] - When you add [lm=5] next to @p it creates a conditioner. lm stands for 'level minimum' so the command block will only give the closest player a diamond sword IF he/she has a minimum level of 5.
276 - This is the item ID for diamond sword. Change this to whatever you want the item to be.
1 - This is the amount of items that will be distributed to the player.
Entering give @p[lm=5] 276 1 in a command block means that, when the command block is powered, if the CLOSEST player to the command block has AT LEAST 5 levels of xp they will receive 1 diamond sword.
Second Command Block:
The command block that removes xp from the player.
xp - the command that can remove or add experience or experience levels to a player or players.
-5l - Putting a - means that you are going to REMOVE experience from the player, 5 is the amount, and adding an l to the end changes it to the LEVEL of experience.
@p - This means the command will interact with the player CLOSEST to the command block. (@a means ALL players and @r picks a random player)
[lm=5] - When you add [lm=5] next to @p it creates a conditioner. lm stands for 'level minimum' so the command block will only remove 5 exp levels from the closest player IF he/she has a minimum level of 5.
Entering xp -5l @p[lm=5] in a command block means that, when the command block is powered, 5 levels of exp will be REMOVED from the CLOSEST player IF they have AT LEAST 5 levels.
This shop concept is GREAT for adventure maps and could also be used on servers. If you want to see some examples of this shop being used, download one of my maps and the shops are incorporated in the maps.
Zombie Arena:
An arena mini-game
Zombie Arena 2:
The sequel to the famous Zombie Arena mini-game
The Crypt:
A thrilling adventure in a monster-infested graveyard full of dangerous traps and rich treasures
I hope this helps! If you have questions, ask in the comments and I will help you out
Red_Jay
Check out my server!
Check out my server!
Check out my server!
Damn. Where's my generator?
(The design on the right)
This fixes the issue because both command blocks are activated at the same time.
The only drawback of this is that it is not as compact as the original design.
Hope this helps.
Check out my server!
:)and... so... Full SUpport!
This steak is so rare I threw a masterball at it!
-Gordon Ramsay... maybe... someday?
Nope, he won't say it
Check out my server!
P.S. This was awesome so im book marking it!
Check out my server!
How do you do this and what does it mean. Could you post a screen shot?
A more compact version of your design.
Same design, but I changed some text. First, I used a radius (r=15) so that it will not look for any players that meet the qualification. Next I used a different money. I made a Points objective using the new scoreboard system (you must type "/scoreboard objectives add Points totalKillCount (replace totalKillCount with list to see the other kinds of objectives) Points" and then it will count every kill you get) and used that as my score, then removed points from it.
This is a way to sell items using command blocks. The comparator will only send a signal if the first command run. The repeaters on the side resets the comparator to the off state. Change some things and play around with this to understand it better if you don't understand what I did.
Note: I didn't use any specifiers on the sell shop, but you can use them and you can make the diamond sword give you points on a scoreboard objective also (you just need to change the second command block to say "/scoreboard players add @p Points 5" (or however many points you want)).
Also sorry if the pictures don't work.Edit: doesn't look like they worked could you tell me what I did wrong so I can fix them?Edit: Thanks for your help, and I hope someone learns something from my screenshots.
Check out my server!
But what do these commands do: clear
scoreboard players remove
Just want to know
It didn't work.
I fixed it though! Works great!