Hello, Minecraft Forum! Here I am proposing a new selector for command blocks - @c! See the diagram below:
Here, we have 3 command blocks. When the button is pushed, the first command block will be activated. This will simply test to see if any players in the world have their last hotbar slot selected. If any do, the command block will provide an output, activating the second command block (as the second command block is conditional and always active).
This is where @c comes in. The @c selector only works in a conditional command block, and the command block which it relies on to activate must contain a selector. The @c selector targets anything that was targeted by the previous command block. In this example, everybody who has their last hotbar slot selected will be teleported 5 blocks above this command block. This happens even if those players no longer have their last hotbar slot selected, or if other players now do. Only the players detected by the first command block will be affected.
As the next command block is also conditional, it will activate after players are teleported. This command block will announce the names of every player who was teleported, and say that they have been teleported! The @c selector allows for the same entities to be targeted through a string of command blocks, even if conditions that may have before applied to them have changed. This can be done with complex use of scoreboards, but this is much simpler, and will likely have many other applications!
If the command block required for @c contains multiple selectors, @c will default to target the first selector which appears in the command. You can change this by typing @c[i=2], @c[i=3] and so forth, which will target whatever was targeted by the previous command block's second and third selectors, respectively. I'm not too sure how the syntax exactly works, so feel free to correct me. I don't even know if you can have three selectors in one command block, honestly. Probably.
Other instances of use
Here are a couple of other examples of contraptions so you can get an idea of how this works better:
If a command block targets @p, and some conditional command blocks using that command block as their condition target @c, all of the command blocks using @c will target the player initially targeted as @p, even if that player is no longer the closest player to any of the command blocks.
If a command block targets @r, and some conditional command blocks using that command block as their condition target @c, all of the command blocks using @c will target the same random player who was selected by @r. This means that a player can be randomly chosen and then have a string of commands executed on them, without all of the effects on them having to be tied to one command block.
How does it help?
So you might be wondering what a practical use of this is. "Great, you can teleport people places, big woop, now how does this fit into my adventure map?". Well, forum dweller, I have the answer. Or at least one answer.
[i]Multiplayer.[/i]
Today, as of writing, I was bored and decided to make a cooldown-based spell with command blocks. Its pretty simple. You select the glowstone dust on your hotbar and gain a 3 second absorption buff. The glowstone dust turns into ten grey dye. Every second, this number goes down by one. When you run out, you get the glowstone back. This essentially creates a cooldown so you can't spam the spell, and allows for some visual representation of how long the player still has to wait until the can cast again.
Now enough about that. So this took a few command blocks, as you might imagine. Let's look at a small part of this creation. One command block tests to see if they are holding the glowstone, and that causes a conditional to turn it into the ten grey dye. Unfortunately, the conditional block has no way to target the player who the first command block targeted (holding the glowstone) without me just using @p (as this is a single player world). What does this mean? This is useless in multiplayer. Never will two people be able to fight each other with their regeneration spells, simply because when a command block detects who is trying to cast the spell, it cannot send the information on who that person is to another command block. </3
But my suggestion would fix that, and a lot of similar issues which drive people to turn to the likes of server side plugins rather than command blocks. Its quite a shame. Join me on my quest to do as much as possible, full vanilla! Not only would my spellcasting system work in multiplayer, many other command block based systems would gain multiplayer functionality (or much easier to implement functionality, at least)! Who doesn't love functionality?
A Conclusion:
Thank you for reading my suggestion! If you would like to share your opinion, feel free to comment below, but I'd love it if you voted on the poll so I don't have to count posts and all of that nonsense. Have any suggestions or criticisms? Please leave them below!
Heck yes. It's just something I was thinking about when tinkering with command blocks and hating how I couldn't do something like this. I just hope they could actually code this. But I don't see why not, a command block can already log who it targets through its output box thingy anyway.
Oh my goodness, do you KNOW how LONG I've been waiting for somebody to make a good way to implement this.. anyways, complete support! If it gets enough support you should bring it to the Minecraft Suggestions reddit.
Rollback Post to RevisionRollBack
"Are you falling asleep in the middle of my fascinating explanation?" - Qibli
"I can't even dignify that with a snort." - Winter
Oh my goodness, do you KNOW how LONG I've been waiting for somebody to make a good way to implement this.. anyways, complete support! If it gets enough support you should bring it to the Minecraft Suggestions reddit.
I was actually just thinking about that, as its probably more likely to be seen there. I don't have a reddit account though, so I might not ever get around to that, unless somebody wants to copy paste what I've written here onto there. Giving credit and linking back here, of course.
EDIT: I'm in a good mood with the supports, so I changed the OP up a bit and added some info on a proper application of this, in case somebody who reads doesn't see the use other than silly, useless teleporting.
I like the idea, I'm just a bit confused. Could you give an example with the first command blocks' command and the second one would go?
Like how would a situation like:
=======
Repeat Command block
/execute @r[score_TEST_min=1] ~ ~ ~ setblock ~ ~-1 ~ bedrock 0 replace
Conditional? NO
Type? Always Active
=======
Chain Command block
/execute @c ~ ~ ~ COMMAND
Conditional? YES
Type? Always Active
======
What I think it is saying:
When the execute command runs the above (1st) command, and it succeds, it will then use the 2nd command and execute COMMAND at the player chosen.
-----------------------------------
I think I'm right, but there's one ploblem: How would multiple selectors work? /execute @a ~ ~ ~ tell @p[score_TEST_min=1] BLAHTEST for example?
I like the idea, I'm just a bit confused. Could you give an example with the first command blocks' command and the second one would go?
Like how would a situation like:
=======
Repeat Command block
/execute @r[score_TEST_min=1] ~ ~ ~ setblock ~ ~-1 ~ bedrock 0 replace
Conditional? NO
Type? Always Active
=======
Chain Command block
/execute @c ~ ~ ~ COMMAND
Conditional? YES
Type? Always Active
======
What I think it is saying:
When the execute command runs the above (1st) command, and it succeds, it will then use the 2nd command and execute COMMAND at the player chosen.
-----------------------------------
I think I'm right, but there's one ploblem: How would multiple selectors work? /execute @a ~ ~ ~ tell @p[score_TEST_min=1] BLAHTEST for example?
Yeah, I think you have the right idea. When the bedrock is placed below the randomly selected player who fits the requirement, the chain command block's command would occur, executed at whoever the bedrock was placed under as if you had typed their name in the command block rather than @c in the first place.
So, my understanding of your command with two selectors is that each player would whisper to the nearest player with scoretestwhatever? I'm not really sure how that would work to be honest.
I'm don't know how the mechanics of this works, but do you think it would be possible to set @c to select a specific selector from the condition block? Maybe you could type something like @c[Instance=1], and it would act as @a because that is the first instance of a selector in the command? I'm not really sure how the syntax is formed, so I don't know if this would be using curly brackets or colons or whatever. Somebody is gonna have to educate me on what the syntax would be, but would something like this work? And without specifying, the block would probably default to the first selector which appears, because the command block is executing /execute @a first and foremost.
Rollback Post to RevisionRollBack
Formerly Gamelord. Pixelmon Server Owner. Server IP: pixelmonprisma.mc-server.net | Server Discord:https://discord.gg/HkK855b
I was actually just thinking about that, as its probably more likely to be seen there. I don't have a reddit account though, so I might not ever get around to that, unless somebody wants to copy paste what I've written here onto there. Giving credit and linking back here, of course.
EDIT: I'm in a good mood with the supports, so I changed the OP up a bit and added some info on a proper application of this, in case somebody who reads doesn't see the use other than silly, useless teleporting.
Reddit accounts are free. I haven't gotten one myself but I think that it doesn't even require an e-mail.
Rollback Post to RevisionRollBack
"Are you falling asleep in the middle of my fascinating explanation?" - Qibli
"I can't even dignify that with a snort." - Winter
I guess this thread is 1 month old, but I would just like to say:
What a wonderful idea! Mojang should really add this.
I've been working with command blocks lately and this would prevent all of the troubles where you add 1 new scoreboard data then have to change ALL your command blocks.
I don't know if that is a disallowed necrobump, but I don't really care. I wanted an excuse to get this alive, I still have hopes.
Maybe if we got it on Reddit, someday... Anyway, I might do an update or something to address some issues and change the format a bit, but not right now. EDIT: Changed a few bits.
I've been working with command blocks lately and this would prevent all of the troubles where you add 1 new scoreboard data then have to change ALL your command blocks.
Although I would like to point out that the [c] target selector argument as already a thing. It stands for count, i.e. @p[c=3] targets the three nearest players. The name could easily be changed though. And yes, it is possible to select multiple entities (/execute @a ~ ~ ~ detect ~ ~ ~ air 0 /execute @a ~ ~ ~ detect ~ ~1 ~ stone 1 /execute @a etc., etc.).
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
Although I would like to point out that the [c] target selector argument as already a thing. It stands for count, i.e. @p[c=3] targets the three nearest players. The name could easily be changed though. And yes, it is possible to select multiple entities (/execute @a ~ ~ ~ detect ~ ~ ~ air 0 /execute @a ~ ~ ~ detect ~ ~1 ~ stone 1 /execute @a etc., etc.).
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
@c
Hello, Minecraft Forum! Here I am proposing a new selector for command blocks - @c! See the diagram below:
Here, we have 3 command blocks. When the button is pushed, the first command block will be activated. This will simply test to see if any players in the world have their last hotbar slot selected. If any do, the command block will provide an output, activating the second command block (as the second command block is conditional and always active).
This is where @c comes in. The @c selector only works in a conditional command block, and the command block which it relies on to activate must contain a selector. The @c selector targets anything that was targeted by the previous command block. In this example, everybody who has their last hotbar slot selected will be teleported 5 blocks above this command block. This happens even if those players no longer have their last hotbar slot selected, or if other players now do. Only the players detected by the first command block will be affected.
As the next command block is also conditional, it will activate after players are teleported. This command block will announce the names of every player who was teleported, and say that they have been teleported! The @c selector allows for the same entities to be targeted through a string of command blocks, even if conditions that may have before applied to them have changed. This can be done with complex use of scoreboards, but this is much simpler, and will likely have many other applications!
If the command block required for @c contains multiple selectors, @c will default to target the first selector which appears in the command. You can change this by typing @c[i=2], @c[i=3] and so forth, which will target whatever was targeted by the previous command block's second and third selectors, respectively. I'm not too sure how the syntax exactly works, so feel free to correct me. I don't even know if you can have three selectors in one command block, honestly. Probably.
Other instances of use
Here are a couple of other examples of contraptions so you can get an idea of how this works better:
How does it help?
So you might be wondering what a practical use of this is. "Great, you can teleport people places, big woop, now how does this fit into my adventure map?". Well, forum dweller, I have the answer. Or at least one answer.
[i]Multiplayer.[/i]
Today, as of writing, I was bored and decided to make a cooldown-based spell with command blocks. Its pretty simple. You select the glowstone dust on your hotbar and gain a 3 second absorption buff. The glowstone dust turns into ten grey dye. Every second, this number goes down by one. When you run out, you get the glowstone back. This essentially creates a cooldown so you can't spam the spell, and allows for some visual representation of how long the player still has to wait until the can cast again.
Now enough about that. So this took a few command blocks, as you might imagine. Let's look at a small part of this creation. One command block tests to see if they are holding the glowstone, and that causes a conditional to turn it into the ten grey dye. Unfortunately, the conditional block has no way to target the player who the first command block targeted (holding the glowstone) without me just using @p (as this is a single player world). What does this mean? This is useless in multiplayer. Never will two people be able to fight each other with their regeneration spells, simply because when a command block detects who is trying to cast the spell, it cannot send the information on who that person is to another command block. </3
But my suggestion would fix that, and a lot of similar issues which drive people to turn to the likes of server side plugins rather than command blocks. Its quite a shame. Join me on my quest to do as much as possible, full vanilla! Not only would my spellcasting system work in multiplayer, many other command block based systems would gain multiplayer functionality (or much easier to implement functionality, at least)! Who doesn't love functionality?
A Conclusion:
Thank you for reading my suggestion! If you would like to share your opinion, feel free to comment below, but I'd love it if you voted on the poll so I don't have to count posts and all of that nonsense. Have any suggestions or criticisms? Please leave them below!
Heck yes. It's just something I was thinking about when tinkering with command blocks and hating how I couldn't do something like this. I just hope they could actually code this. But I don't see why not, a command block can already log who it targets through its output box thingy anyway.
EDIT: I added a poll. Pwease vote.
Oh my goodness, do you KNOW how LONG I've been waiting for somebody to make a good way to implement this.. anyways, complete support! If it gets enough support you should bring it to the Minecraft Suggestions reddit.
"Are you falling asleep in the middle of my fascinating explanation?" - Qibli
"I can't even dignify that with a snort." - Winter
"This is important and fascinating!" - Starflight
"You're nonagashabibble." - Squid
I was actually just thinking about that, as its probably more likely to be seen there. I don't have a reddit account though, so I might not ever get around to that, unless somebody wants to copy paste what I've written here onto there. Giving credit and linking back here, of course.
EDIT: I'm in a good mood with the supports, so I changed the OP up a bit and added some info on a proper application of this, in case somebody who reads doesn't see the use other than silly, useless teleporting.
I like the idea, I'm just a bit confused. Could you give an example with the first command blocks' command and the second one would go?
Like how would a situation like:
=======
Repeat Command block
/execute @r[score_TEST_min=1] ~ ~ ~ setblock ~ ~-1 ~ bedrock 0 replace
Conditional? NO
Type? Always Active
=======
Chain Command block
/execute @c ~ ~ ~ COMMAND
Conditional? YES
Type? Always Active
======
What I think it is saying:
When the execute command runs the above (1st) command, and it succeds, it will then use the 2nd command and execute COMMAND at the player chosen.
-----------------------------------
I think I'm right, but there's one ploblem: How would multiple selectors work? /execute @a ~ ~ ~ tell @p[score_TEST_min=1] BLAHTEST for example?
Mewtwo is the best pokemon!
Support. While I'm not much of a command blocker myself, I can see the potential uses of something like this.
I support this, this, and this. And this now. Also this.
Yeah, I think you have the right idea. When the bedrock is placed below the randomly selected player who fits the requirement, the chain command block's command would occur, executed at whoever the bedrock was placed under as if you had typed their name in the command block rather than @c in the first place.
So, my understanding of your command with two selectors is that each player would whisper to the nearest player with scoretestwhatever? I'm not really sure how that would work to be honest.
I'm don't know how the mechanics of this works, but do you think it would be possible to set @c to select a specific selector from the condition block? Maybe you could type something like @c[Instance=1], and it would act as @a because that is the first instance of a selector in the command? I'm not really sure how the syntax is formed, so I don't know if this would be using curly brackets or colons or whatever. Somebody is gonna have to educate me on what the syntax would be, but would something like this work? And without specifying, the block would probably default to the first selector which appears, because the command block is executing /execute @a first and foremost.
Full Support
As an avid command block user, I can see tons of potential in this, especially with @r.
Reddit accounts are free. I haven't gotten one myself but I think that it doesn't even require an e-mail.
"Are you falling asleep in the middle of my fascinating explanation?" - Qibli
"I can't even dignify that with a snort." - Winter
"This is important and fascinating!" - Starflight
"You're nonagashabibble." - Squid
So many supporters!
Maybe this is just what happens when you post a suggestion which isn't already stupidly controversial. Thanks for all the input everybody.
I guess this thread is 1 month old, but I would just like to say:
What a wonderful idea! Mojang should really add this.
I've been working with command blocks lately and this would prevent all of the troubles where you add 1 new scoreboard data then have to change ALL your command blocks.
~ Crows
Avatar Mod 2 -- Elemental Bending from Avatar: The Last Airbender
Contact: PM or [email protected]
I don't know if that is a disallowed necrobump, but I don't really care. I wanted an excuse to get this alive, I still have hopes.
Maybe if we got it on Reddit, someday... Anyway, I might do an update or something to address some issues and change the format a bit, but not right now. EDIT: Changed a few bits.
I hardly touch scoreboards. Too confusing for me.
This would indeed be awesome. I support this!
Although I would like to point out that the [c] target selector argument as already a thing. It stands for count, i.e. @p[c=3] targets the three nearest players. The name could easily be changed though. And yes, it is possible to select multiple entities (/execute @a ~ ~ ~ detect ~ ~ ~ air 0 /execute @a ~ ~ ~ detect ~ ~1 ~ stone 1 /execute @a etc., etc.).
May the ores be with you.
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
Oh, thanks, I'll change that then. Is [i] okay?
This seems like it would be useful, but it's not that hard to use scoreboards.
Yep, that's not used yet in Vanilla. Although on here(the forums), that's a code for itallics.
May the ores be with you.
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
This could allow for more flexibility in custom maps.
SUPPORT
Check out my PvP map Here!
Check out my website Here!Website is down until further notice.