So I am trying to make a simple item shop that tests for if the player has a bed in their inventory, and if so, gives them a secured bed item from davinci's vessels.
/give @p davincisvessels:securedbed (works fine, based on the trigger)
/clear @p minecraft:bed 0 1 (works fine on its own)
For some reason when I pair the first two command blocks together (pictureshere), they work fine, and when I do the third on its own (pictureshere) it works fine as well. But when I pair all 3 of them together (as is needed to make the simple item exchanger), only the first two work, and the last one does not work at all.
What am I doing wrong here? Am I writing the parameters wrong? I've been trying to do this by going off of commands I saw on the Minecraft Wiki and youtube tutorials.
The clear command does nothing when placed at the end of the chain.
Also yes @YMbrothers DaVinci's Vessels is a mod. You haven't heard of it?
No I haven't (I don't play mods, haha)
I think the key is how the command is run and in what order do you place them.
If it's singleplayer, Make sure the /testfor is a repeating command block, /give and /clear are in CONDITIONAL chain command block (otherwise you will just get endless secured beds), all 3 command blocks are in Always Active mode.
I did just remember one other thing. Is there a way to change the input for the converter from a manual player-activated switch to a server-wide chat trigger? Like, let's say one player (this is for a multiplayer server) wants to convert their bed to a secured bed. Can they do that remotely with a chat command without it affecting other players?
Also "/clear @p minecraft:bed 0 1" does not clear any colored beds, it only clears the white bed from the player's inventory.
I did just remember one other thing. Is there a way to change the input for the converter from a manual player-activated switch to a server-wide chat trigger? Like, let's say one player (this is for a multiplayer server) wants to convert their bed to a secured bed. Can they do that remotely with a chat command without it affecting other players?
Also "/clear @p minecraft:bed 0 1" does not clear any colored beds, it only clears the white bed from the player's inventory.
You specified the bed type as "0" there so yes it will only clear the default white bed. Set it to -1 if you want it to clear any kind of bed.
I'm confused as to why @p isn't good enough. Isn't this a clickable sign or lever? And you don't want something like this spamming your server chat constantly. Anyway, ignoring the reasons, the answer is yes. You can format text that posts to public chat in a way that players can click parts of it using tellraw and JSON formatting with clickEvent. The command you want to run is a trigger command where the player sets their own trigger scoreboard to a value. All players have permission to do this. If you don't use a trigger scoreboard then non-OP players will not have permission to run the command so you need to do it this way on public servers. Anyway, there are a lot of details to this and I don't feel like explaining them all so I'll just link SkyLiner's post on JSON formatting. I will say you will have to declare a scoreboard of the type "trigger" and enable it and you also need to reenable it after every player click. What I do is I have a trigger variable called "talk". Each unique click in branching dialogue has an id and the game detects when talk becomes nonzero for a player (they clicked) and runs the commands associated for that click on players that have the value. This makes clickable commands runnable from chat possible in multiplayer regardless of if a player is OP or not. I recommend putting it in a book you give players on login though instead of a introductory chat message. Players can hold onto the book and use it multiple times so it is more useful.
Space Expedition to EPIC 204:Go on a Space-Age Adventure to visit and explore EPIC 204, a wacky world of dense asteroids and full of alien life! Experience Custom Seasons, Weather, Over 50 new creatures, Beautiful Biomes, Alien Ruins, Dungeons, and new space age tech crafting recipes!
So I am trying to make a simple item shop that tests for if the player has a bed in their inventory, and if so, gives them a secured bed item from davinci's vessels.
This is what my command block setup looks like:
For some reason when I pair the first two command blocks together (pictures here), they work fine, and when I do the third on its own (pictures here) it works fine as well. But when I pair all 3 of them together (as is needed to make the simple item exchanger), only the first two work, and the last one does not work at all.
What am I doing wrong here? Am I writing the parameters wrong? I've been trying to do this by going off of commands I saw on the Minecraft Wiki and youtube tutorials.
My version of Minecraft is 1.12 by the way.
Is davincisvessels a mod or sth?
The clear command does nothing when placed at the end of the chain.
Also yes @YMbrothers DaVinci's Vessels is a mod. You haven't heard of it?
No I haven't (I don't play mods, haha)
I think the key is how the command is run and in what order do you place them.
If it's singleplayer, Make sure the /testfor is a repeating command block, /give and /clear are in CONDITIONAL chain command block (otherwise you will just get endless secured beds), all 3 command blocks are in Always Active mode.
If this solution does not work, just tell us.
Wow I think that worked! Thank you! I'll let y'all know if it works out alright.
I did just remember one other thing. Is there a way to change the input for the converter from a manual player-activated switch to a server-wide chat trigger? Like, let's say one player (this is for a multiplayer server) wants to convert their bed to a secured bed. Can they do that remotely with a chat command without it affecting other players?
Also "/clear @p minecraft:bed 0 1" does not clear any colored beds, it only clears the white bed from the player's inventory.
You specified the bed type as "0" there so yes it will only clear the default white bed. Set it to -1 if you want it to clear any kind of bed.
I'm confused as to why @p isn't good enough. Isn't this a clickable sign or lever? And you don't want something like this spamming your server chat constantly. Anyway, ignoring the reasons, the answer is yes. You can format text that posts to public chat in a way that players can click parts of it using tellraw and JSON formatting with clickEvent. The command you want to run is a trigger command where the player sets their own trigger scoreboard to a value. All players have permission to do this. If you don't use a trigger scoreboard then non-OP players will not have permission to run the command so you need to do it this way on public servers. Anyway, there are a lot of details to this and I don't feel like explaining them all so I'll just link SkyLiner's post on JSON formatting. I will say you will have to declare a scoreboard of the type "trigger" and enable it and you also need to reenable it after every player click. What I do is I have a trigger variable called "talk". Each unique click in branching dialogue has an id and the game detects when talk becomes nonzero for a player (they clicked) and runs the commands associated for that click on players that have the value. This makes clickable commands runnable from chat possible in multiplayer regardless of if a player is OP or not. I recommend putting it in a book you give players on login though instead of a introductory chat message. Players can hold onto the book and use it multiple times so it is more useful.
http://www.minecraftforum.net/forums/minecraft-java-edition/redstone-discussion-and/351959-1-12-json-text-component-for-tellraw-title-books
Download and play my new Survival Map!
Space Expedition to EPIC 204: Go on a Space-Age Adventure to visit and explore EPIC 204, a wacky world of dense asteroids and full of alien life! Experience Custom Seasons, Weather, Over 50 new creatures, Beautiful Biomes, Alien Ruins, Dungeons, and new space age tech crafting recipes!