How to Make an NPC Shop in Minecraft *Bedrock*
ฝัง
- เผยแพร่เมื่อ 3 ต.ค. 2024
- In this video I will be showing how to create a NPC SHOP that you are able to make custom shop items to sell or buy with an NPC! Use this in your minecraft bedrock world! if you have any tutorial suggestions or questions feel free to share them in the comments! :))
I remember when you were still under 1k subs, awesome to see how much you've grown. I still use your tutorials over any others.
@@notwhitecat5697 amazing! Love it!
Bro if you do this is that chance here if semeobody near you that command thinks that players is subject @@gabedala
@@That_One_Dark_Man yeah, you could also put a radius. But I also made a new updated version where you don’t use command blocks and it won’t detect the closest person
@@gabedala I know it
But that command dont work I dont know why
You can put multiple command in a single npc button command like this
/give @p
/scoreboard players remove @p Token
This is an excellent explanation of a way to do NPC shops. However, one big problem note is this executes on the person nearest the command, which may *not* be the person interacting with the NPC. If you are interacting with the NPC and I see that, I can troll you by clicking "buy item" and it will force the person nearest the command block (you) to do the transaction.
There are some ways to problem solve this but what's best sort of depends on a case by case basis, but basically rely on restricting NPC interactions to one player at a time.
The one I use is having 1 player step on a block that teleports them to a specific spot in front of the NPC where the 1 player and the NPC are encased in barrier blocks. Then if another player attempts to step on the block you can do a check to see if a player is already "in front of the register" and not allow them in until the previous player is done.
A great advantage here is I can create a structure block with a custom item in it, save it, and when the player buys it you can load the structure block right above them and the custom item will land on them.
Having designated areas for players to stand in also has another cool possibility, which is to have a Venmo type area where a player stands on the "sending" and "receiving" blocks, and using the NPC and command blocks to set the scoreboard and give each other money.
I'm trying to figure out a way to do "safe" bartering between players using NPCs, where you have 10 diamonds and I have 100 "cash points" and we can somehow trade without the other person getting screwed, but I can't figure out how to do it without having a button for every possible trade combination, which means no custom trades (which sort of defeats the point).
Love the design you have; it's super efficient.
why not use *@initiator* ?
All of this is unnecessary. Using the @initiator will work perfectly fine if combined with @s or @p. Note that @initiator will ONLY work for NPCS. Not command block or chat. :)
or you can do @p[x=(npc x),y=(npc y),z=(npc z)]
This was so helpful thank you so much!
You're so welcome!
This fix my problem with making shops huge just to buy/sell lot of items. Now I can have the shop blocks in a tick area instead of making a big shop with command blocks hidden in it.
Thanks for the tutorial man i was looking for way to make ths without addons
For those who dont know how to do the /scoreboard cmd
First
Type /scoreboard objectives add [whatever you want] dummy
Then
Type /scoreboard objectives setdisplay sidebar [whatever you want]
Then type /scoreboard players add @a / @s [whatever you want] [whatever number you want]
i type /scoreboard objectives add Money then i get a error. ": at " add Money>>
@@yukamina369you have to put dummy after [currency name]
@@yukamina369 ik this was 10 months ago but you gotta put in a display name after Money.
Found it lol this took me for ever to find thank gab
Amy way to test for items that a play has then remove them then give them a diff item
It’s all working but not giving me the items, and there’s no previous output on the chain command blocks, what’s going on? Please respond to me.
Double check your command blocks and their settings and the text you wrote
bro i think they changed how command blocks work in 1.21
Is it possible to make the shop tied to an item? Like if you hold an emerald it takes you to the shop no matter where you are.
Yes. You can use a item holding selector so when you hold an emerald it will tp that player
/execute if entity @a[hasitem={item=emerald,location=slot.weapon.mainhand}] run dialogue open @e[npc stuff here] @a[hasitem={item=emerald,location=slot.weapon.mainhand}]
So useful i got many tutorials that works i just read the chat but it was like 13 command blocks for 1 trade thats gonna take hours but this is just minutes bc 5 command blocks and thats why i chosse you over all other
You could also add a /tag @initiator to the npc so whoever initiated the button gets the item
Yeah this is an old tutorial, I made updated ones
@@gabedala Thanks! Just watched it, helped me a lot!
Honestly some of ur vids worked and some did for me so… what version u doin all these tutorials on? Java or bedrock?
Bedrock Edition
Oh well thanks and btw can u pls make a kill shop and a kill board tutorial, I’m actually making an smp and taking ideas from u 😅
Thanks ❤
You're welcome 😊
When i try the results thingy says "No objective was found by the name 'Cash' "
That means you need to create an objective. With /scoreboard objective add. Then you can name it whatever you want
@@gabedala Oh thanks
😅thanks too
Thanks 3 😂😂😂😂😂
@@gabedalacan you please make one where it's with items like diamonds or emeralds
Bro this is by far the best tutorial ever u need so much more hype😢!!! I followed step by step and it works perfectly!!!
Thank you! I do my best to make my tutorials short sweet and simple. Plan to upload a lot more this next month!
Thank you so much my friend 👍
I was makingg a MW2 based map and i needed a shop so thanks
Im confuesd by the score test because it still gives me a item even if i dont have the funds avaliable
you must set the following chain blocks to CONDITIONAL
Can you make a video for a npc shop with no common block
They only work with command blocks
Here's a video for an npc shop with no command blocks. th-cam.com/video/Wkkcm_p74fI/w-d-xo.htmlsi=1l666Mh3MrHJ0h0G
Why is it only I can buy stuff in the shop but when another player tries to buy something it doesn't work even though he has money?
And for some reason when another player plays my world the username that shows in the scoreboard was my username instead of his username?
How to fix?
@@Sean900 look at my updated videos on my channel!
@@gabedalatrue you made i video a month ago @sean900 can look at that it is ofc better than this one this is a year ago
Gabe can you get me a link to one of your or another youtubers video when they show how to get a scoreboard
Thank u really helpfully
Yeah I have problem
1 you can get the shield without money I don't know why that happend
Maybe because one of your command blocks is unconditional instead of conditional
@@gabedala what all tutorial I watched I didn't work to fix the problem like you get shield without money that's weird☠️ I wish the creator add new command like /trading @p shield 1 for emerald 5 like that:(
Can I make him trade the things I want with diamonds and stuff? Like I don't want the money thing , is that possible??
Like I want to make a bank , so for example I will give the NPC 1 Diamond it will give me 10 Iron back ...etc . Is that possible???
Yes! I’m working on a tutorial for that!
@@gabedala Thank you so much 🤍🔥 , I'll be waiting for it, I hope it will be published soon...
If I want them to pay with gems or diamonds, how would I put it in the command?
Just replace the items I have in the video with diamond and the amount
I like this method much better. All those command blocks are not necessary. Check this EASY method out...I think his method is too complex th-cam.com/video/Wkkcm_p74fI/w-d-xo.htmlsi=1l666Mh3MrHJ0h0G
Now bedwars is amazing for me
So I noticed that although I was at 0 coins in my world I could still buy the items, resulting in me going into the negatives. How do I stop players from being able to purchase with insufficient funds???
Check the command blocks again, there’s a reason why the first block is a testfor to make sure the player has enough money
I got it! I overlooked setting all of my chain command blocks to conditional 🤦🏼♂️ they’ve been at unconditional which seemed to have caused that. Thanks bro! You should upload some more server related command block content.
One last question. Is there a command that can be set which would disable PvP within spawn as well as get rid of hunger? I’ve looked around and have had no luck :(
@@iGramps I wish!! I want to add a pvp area to my realm but bedrock is only so limited 🥲
@@iGramps effect saturation and weakness
How can i make a command where if you have less than 10 money ( the shield is 10 money scoreboard ) it will tell you You dont have enough money and it wont give you the item [NPC]
This is the easiest tutorial so far all of these other people have like 17 command blocks and Its so hard to keep up thank you for your help SUPER UNDERATED
I appreciate the comment and positive feedback! Always loved short and to the point tutorials!
Nice video
It didn’t work with these settings, But I made a few adjustments to it. I didn’t use the scoreboards. When I added commands, I said /clear @p iron_ingot 0 5 and /give @p apple 1, and it worked.
Nice!
How i make it?
Its says i cant find this objective... what i have to do i got it in chat /scoreboard players add @p emerald 10 and its not work HELP ME?
That’s not even the right command…
Hey, could you make one that takes away items, or is it the same for this but replace the coins with items?
Pretty much that, I will make a tutorial on that though!
@@gabedala thank you
I was buying something with my friend nearby and he got all the stuff i purchased, how do i fix this?
You can make it so the command block works if you’re standing in a certain spot
By using the @initiator filter within the npc instead of @p or @s, it will eliminate this issue. Hope this helps!
W to add multiple items in the npc
It works but how can I see how much money I have? Edit: nvm I watched your other videos and it managed to help me, thank you so much!
How what other video😊
The problem is that when you don't have the money and you give priority to what you want, he still gives it to you
That’s true! I didn’t clearly make this known for the tutorial. I believe I can redo this and make it better and more understandable!
Should it work wherever the NPC is? Or is there a range
Infinite range but it’s better if it’s right under the shop. Command blocks need to be close to the player activating it
Ik I'm a little late, but im having a problem. Everything seems to be right, i even fixed the they way the block are faceing. Theres no item nor sound and no money removed
Make sure the command block has the same scoreboard objective that you create. It is case sensitive too! I also made an updated version on my channel where you don’t need command blocks&
IS THERE A SELL VERSION?
Whenever I buy something the red stone won’t replace with air
1. Did you make sure the cords of the command block are exactly the same as the red stone block? 2. Make sure the command block is the right one and it’s got to be facing all the same way.
@@gabedalano it won't replace the redstone iam so Confusion
@@sikonikoniyt8930 gotta make sure the command is correct and you’re setting the right coordinates
@@gabedalawhat version do you play?
@@gabedalaAnd minecraft chat says like this "you can't put blocks outside the world"
Ur the best
No you are!
Can you make working jobs for players so they can get money
How do i get money 10??
Hi he dont give the items
I don’t think it works in 1.20.10
It does! I will make an updated version soon!
I have a better way of doing this. You can actually write multiple commands in the npc, kind of like actual code that will run when the button is pushed and instead of using @p you can use @initiator so it will only give the person who pushed the button the item.
Edit: the way you add multiple commands to an npc is literally just drop a line and add a new command...
Yeah I didn’t know this at the time! Will make an updated video on it!
Once i put /scoreboard players test @p Money 10 it didnt work
And the /scoreboard players remove @p Money 10
And then you know what Happened IT DIDNT WORK!
1:i have a scoreboard
2: Any ideas why?
It doesn’t give me the item
I made an updated version in this
Ty
Is there a way to make the commands all in the NPC itself?
When I Input the command and press enter it just puts my on a new line and doesn’t actually set the command anyone know how to fix this?
Is there a way to do this with enchanted and named items? I really need to find out for an adventure map im working on
No such thing as enchanted or named items, bedrock is so limited to certain commands unfortunately
@@gabedala ah thank you, I thought so but I wanted somebody to confirm it for me, I'll have to figure something else out
You can use structure load
You could have it instead of giving you the item, place a barrel on a location using the clone command with your item in it, then follow it up with another command that sets that block to air using the command (setblock (coords) air 0 destroy) and a repeating command block killing all barrels.
@@T.O.L.Dyes you could potentially just load a chest using a structure block in which you will set it to air destroy where the block breaks and drops the enchanted item. This also works with just structure blocking a item saved but I’m not sure if they patched that yet
can I change Money by any other item, like emerald?
Yes
Is there a way to make it to where it would take an item (such as rotten flesh, bones, etc) instead of using scoreboard commands?
give me a few minutes
so first you want a repeating command block then you want to have it as redstone only then you put Setblock ~~1~ stone. the next thing you do is put another command block down make sure its chain, and conditional always active, then you type clear @p rotten flesh 1, you could change the item with what ever, same thing with the number.
then you follow the steps in the video just change those things few things, oh and also find the block on top of the first one, not next to it.
Yes easy!
Is it possible to have shop keepers sell custom armour. For instance, i would like my keeper to sell an armour with a trim and a custom name. Would that be possible?
Hmm, I’m not entirely sure tbh. I will look into it though!
Yes it is possible by saving the custom item/armor in a structure then load in the structure on the player when you need to give it to them. So you basically save the custom item as a structure using a structure block, then you can use this command inside an npc: execute at @p run /structure load NAME ~~1~ 0_degrees none true false , and it should give them the custom item. Put the name of your saved structure where it says NAME in the command. I will have a video on this in a couple of days on my channel...I currently have this one th-cam.com/video/Wkkcm_p74fI/w-d-xo.htmlsi=1l666Mh3MrHJ0h0G which is a basic shop setup with an npc that is super easy...no command blocks..just a few commands.
@@gamedy2k thanks
Can you make a tutorial where its the smae thing but with items like emeralds or diamonds? Please?
All you need to do is change the item name to emerald / diamond
If I'm the owner is there a way I can give myself money?
Or others
Yes! Just type /scoreboard players add [name] [money] [amount]
Can u make a video about player trade system
Can you elaborate on this
@@gabedala like it pop up a request and say. (player) wants trade with u and do u accept or decline. When u press accept it pops a grid and ur inventory and maybe a chat beside it
You would need an add-on to do that. No command blocks would be allowed to that
@@gabedala i try to but it doesn’t work
What is the minecraft version
This is outdated but I made a new dated one on my channel
How do you get money
/setblock coordinate air /scoreboard players test @p money 10 /scoreboard players remove @p money 10 /give @p /playsound random.orb @p
Will the same commands also works on other npc's I'm going to summon?
You’d have to make the system again
It don’t work
It don’t give me shield, and I’ve followed everything perfectly,
I really need this bc im making my own server and im gonna have bedwars so thats why this is so useful my server name is going to be HYCRAFT that i got inspired from two big servers the biggest java server and biggest bedrock server HYPIXEL and CUBECRAFT i took HY from HYPIXEL and CRAFT from CUBECRAFT HY + CRAFT = HYCRAFT but still i need to know how to get a scoreboard i will just wait for you to respond to me maybe when my server relises its conne be a sucsess all for you thanks so much gabe
The redstone block stays it doesn’t go away
Um how do you do it with like a money score board but with diamonds
I made a video on my page updated but without a money scoreboard. But if you want a scoreboard you just need to combine the two which I should make a video on how to do
why is the actionbar not working?
can u make a vid showing how you would add more items to the shop pls
Yeah! I was planning on making a whole new video about it!
@@gabedala ty so much bro me and my friend making a server and really need this asap ur amazing bro
Tysm
Hi is there a way to buy costum items like a name_tag...because i use name tags as keys for my redstone hotel?🙏
Hmm, idk if you could buy custom named items. Unfortunately bedrock can only do so much. I can look into it too!
Does this still give you the item if you don't have the score?
No! It should not give you the item if you don’t have the score amount
@@gabedala i actually tried it out, and it worked correctly
Question can you make a selling npc shop ?
Yes
How do you make the money in the side like you use doobucks
I have a video on my page I posted called “how to make a money scoreboard” one of my most recent videos!
@@gabedala on watching it now I sent a comment about a question on it
I have done everything command blocks are the exact same but it just doesnt work
I made an updated version on the channel where command blocks aren’t needed
I did all of it right and the Redstone block spawns but it doesn't give me the item
Working on a faster and better way to make this shop!
i want to know how to change the sizse of the buttons to make it look like eggwars/bedwars/cakewars's shop
You need to make add ons/texture pack
Hey there how would allow the currency to be dropped by mobs etc for an adventure map to act as loot I would prefer emeralds?
Yes there is a way! Just a lot of commands
@@gabedala do you know where to find?
hey how to i want to people to give the shop 5 soemthing and get the coins instead of getting rid of them ????
My red stone block don’t disappear
It still deducts my money even though i have less, and my money ends up in negative
How about with gold? Using golds to buy
You can do anything
It keeps saying that it doesn’t know about that spawn egg like it keeps saying error
Hi so I’m trying to make one like this for a skygen and my problem is I do not know how to make it so a certain player is tested cleared and given an item so I would like help with that
A little late, but if you tp the player to the npc, then use the @p commands it should work unless there are multiple people at a shop. To fix this, you can make a system to only allow one person to use the shop at a time
I only have 1 questions. Is it possible to make it so i dont need money to buy the item and i need a material for example like iron ingot?
Yes it’s possible!
@gabedala this too if you get this notification where do you find these?
can you tell me how to make an npc's name tag always show?
I think there’s an add on you can download for that
Okay thanks
how do i gain points/money without using command??
like killing mobs give points/money
Man! That’s a hard one! I would love to find that out and I’ll go looking for a way to do that or if it’s even possible!
@@gabedala i thinks it impossible. but ty for replying.
@@Joak-z it’s actually not impossible, I found a tutorial on how to do it. There might be a few tweaks and work arounds for it.
@@gabedala it is still need commandblock?
@@Joak-z yeah, still need a command blocks
All you have to do now is /summon NPC and it will summons a npc. no longer need the egg.
But u can spawn npc more faster with the egg
It allows me to go into negative money and idk how to fix that
Make a shop that tests for the money before it gets taken out
Mine won't work I got the commands down on paper and hooked it up it doesn't say error just nothing's happening
I’ll have to make an updated version that clearly explains it more
That's nice of you thanks
what if you want to sell one item for another and not money
I have a tutorial of that on my channel I posted 2 weeks ago! Check it out!
Please help, I did it and everything worked, but once I had less than 10 money it started going into negatives
Double check commands!
@@gabedala Thank you so much! It worked! I've been looking for this forever, but it works! One question though: Is there a way to make it so it's the specific player that bought it? The @p works and all, I was just wondering because sometimes they actually get the item the other person paid for because they were closer
Can you use custom items with data like enchantments and names?
Yes but not with command blocks
@@gabedala how i wan tt oknow please
sooo... a tried this in the pocket edition and commandblocks don't send redstone signals/outputs so... i'm really sad and mad at the same time :>
all tho, still wanderfull video, quick and simple, i'm sure many will found it usefull... unlike me
GOD DAMM POCKET EDITION AAAAHHHH
Oh man really?? Isn’t pocket edition part of bedrock? Definitely thought it is! And it’s not a red stone signal it’s sending. It’s placing the air/block with a redstone block. Not redstone dust
the thing is, the impulse block doesn't activate the chain block ahead despite facing to their direction, it's gotta be a thing of the mobile port
@@weakny1830 interesting, gotta hop on a console then
I need help it won’t work
thank you very much i can finaly troll my friends with this now!
How can you troll?
@@gabedala by fooling my friend with the npc trader while i am in vanish
So in the GIVEITEM block do I put the item like this "husk_spawn_egg" or just Husk Egg? It didn't give the egg even though I did it all.
I’m not sure the correct way for the husk spawn egg. Each item is kinda different. But husk_spawn_egg should work
@@gabedala Thanks.
Its not giving me the item i chose and isn’t doing the sound how do i fix that
Pls how to another items in comand, efficiency 1 2 3 4 or 5 plsss
Why doesn’t mine work because I did the command /scoreboard players remove @p Money 1 but when I try it doesn’t work. I have the objective it just says Syntax error:Unexpected “ “: at Money>>
Never mind. Found my problem
Glad it worked!