Trying to make a market using command blocks. So far, all I see online are people making shops where you use xp as currency, which imo is quite lame. Is there not a way for the command to take ITEMS rather than xp? I've looked around and can't find anything. Just seems dumb that a simple command like "take" or "remove" doesn't work, which potentially create such an entirely awesome feature.
Example:
You push a button, it checks if you have 16 iron, if you do, it gives you a diamond, and REMOVES your 16 iron.
Basically you just paid 16 iron for 1 diamond.
Is there something I'm missing? Or is it just not implemented yet?
I'm not sure of what could be done in the scoreboard system in 1.7.10 but if you can add your own objective to the system, say Balance, you could probably set up some hoppers and a command block so you throw some iron in a hopper, it goes through a simple item sorter that spits out anything other than iron and feeds the iron to a counter that makes the command block increment the Balance objective of the closest player. Then use Balance instead of XP in the shop?
You could put a pressure plate operating a piston door in front of the ATM machine taking the iron so that the person throwing in the iron can be certain that nobody else can run in and get the added Balance.
The Meaning of Life, the Universe, and Everything.
Location:
Sitting on a Command Block
Join Date:
11/15/2015
Posts:
53
Location:
Earth
Minecraft:
Datatag
Member Details
Dear Cosmology27;
I'll try to assist you in maybe 5h from now, now I'm busy.
It should be possible though.
Sincerely,
Datatag
UPDATE
Okay- you could either create a Villager Shop (try this link), or have the items converted into scoreboard currency, for example by dropping them into a hopper, etc. The thing is, you can test whether the player has the amount of items, but you can't remove a specific amount of them, only all or none. I think you should just have the items converted into scoreboard currency, if you need help with that, reply.
So that villager creation thing looks AWESOME and simple, honestly best thing ever, thank you!
Now for the scoreboard balance/currency, that sounds really cool too! I have no idea how to do this though, so if you wouldn't mind giving instructions or a link I'd be even more appreciative.
The Meaning of Life, the Universe, and Everything.
Location:
Sitting on a Command Block
Join Date:
11/15/2015
Posts:
53
Location:
Earth
Minecraft:
Datatag
Member Details
Dear Cosmology27;
Sure, glad to help!
So, you know what a Villager shop would look like. A scoreboard shop: for example, you can drop an item into a hopper, and you get "credits", which in turn you can spend on items or whatever. I'd assume a Villager shop is better for you. This is pretty easy to use.
Now random question. If I make a villager that is indestructible (which is one of the options), how can I get rid of him? Even creative with OP doesn't seem to let me get rid of him.
Now random question. If I make a villager that is indestructible (which is one of the options), how can I get rid of him? Even creative with OP doesn't seem to let me get rid of him.
Run this command, it'll kill all Villagers within 3 blocks of you.
/kill @e[type=Villager,r=3]
This'll kill all Villagers within 10 blocks of you.
Now random question. If I make a villager that is indestructible (which is one of the options), how can I get rid of him? Even creative with OP doesn't seem to let me get rid of him.
Maybe try this command while standing next to the villager:
Trying to make a market using command blocks. So far, all I see online are people making shops where you use xp as currency, which imo is quite lame. Is there not a way for the command to take ITEMS rather than xp? I've looked around and can't find anything. Just seems dumb that a simple command like "take" or "remove" doesn't work, which potentially create such an entirely awesome feature.
Example:
You push a button, it checks if you have 16 iron, if you do, it gives you a diamond, and REMOVES your 16 iron.
Basically you just paid 16 iron for 1 diamond.
Is there something I'm missing? Or is it just not implemented yet?
I'm using 1.7.10.
I'm not sure of what could be done in the scoreboard system in 1.7.10 but if you can add your own objective to the system, say Balance, you could probably set up some hoppers and a command block so you throw some iron in a hopper, it goes through a simple item sorter that spits out anything other than iron and feeds the iron to a counter that makes the command block increment the Balance objective of the closest player. Then use Balance instead of XP in the shop?
You could put a pressure plate operating a piston door in front of the ATM machine taking the iron so that the person throwing in the iron can be certain that nobody else can run in and get the added Balance.
Just testing.
I'll try to assist you in maybe 5h from now, now I'm busy.
It should be possible though.
UPDATE
Okay- you could either create a Villager Shop (try this link), or have the items converted into scoreboard currency, for example by dropping them into a hopper, etc. The thing is, you can test whether the player has the amount of items, but you can't remove a specific amount of them, only all or none. I think you should just have the items converted into scoreboard currency, if you need help with that, reply.
So that villager creation thing looks AWESOME and simple, honestly best thing ever, thank you!
Now for the scoreboard balance/currency, that sounds really cool too! I have no idea how to do this though, so if you wouldn't mind giving instructions or a link I'd be even more appreciative.
Sure, glad to help!
So, you know what a Villager shop would look like. A scoreboard shop: for example, you can drop an item into a hopper, and you get "credits", which in turn you can spend on items or whatever. I'd assume a Villager shop is better for you. This is pretty easy to use.
P.S. A like would be appreciated.
Just wanted to add a video
.
Hope this helps!
Cool thanks!
Now random question. If I make a villager that is indestructible (which is one of the options), how can I get rid of him? Even creative with OP doesn't seem to let me get rid of him.
Run this command, it'll kill all Villagers within 3 blocks of you.
This'll kill all Villagers within 10 blocks of you.
Be careful!
Hope this helped!
Best wishes,
Datatag
Maybe try this command while standing next to the villager:
by c0yote
I tried it with terrible results. I gave my wife my glasses for a second, a creeper showed up and now my wife is pregnant.
Stupid 3D..
I just tried this out, and it kills me, says there's an error, and doesn't kill the villager.
Is it because I'm running 1.7.10?
When I run this command in a command block, it says "specify which player to perform this action on"
Did you cut and paste the command? It's Villager with a capital V until 1.11in 1.11 I think it's villager with a small v.Yes, it does seem to be because you are running 1.7.10
I'm not sure what the proper command is for that.
--
Ok, you can't use @e before 1.8, I still don't know what you would use instead.
Just testing.
Checking in the Wiki again, it seems that the ability to damage invulnerable mobs when you are in creative mode was added in 1.8 as well.
You could dig a hole underneath him and drop him into the void, or encase him in bedrock and forget about him.
It might be possible to use some sort of editor to remove the "invulnerable" tag, or delete the villager.
Just testing.
Drop in into the void. It seems that's the only way. Here's a thread about that.
Sorry I (kind of) killed you
Best wishes,
Datatag