So, as the title says, why was the "lookfor" command so bad, that it had to be removed?...
Up-vote this post, if you want it back.
Okay, might as well throw in, why I wanted this back, while I'm at it, the reason being, is because it was so much easier to find whatever it was I was looking for in the world, now, it's like: 'tag @e[type=item,nbt={Item:{id:"minecraft:sandstone"}}] add sandstone' and then 'execute as @e[tag=sandstone] at @s run (whatever command)' I mean, why does it have to be harder than it has to be?...
All I want is, to easier move blocks around, and/or remove dropped blocks...
so, it would be appreciated, if someone could help me out with that, that is, moving blocks around, and removing dropped items.
So, as the title says, why was the "lookfor" command so bad, that it had to be removed?...
Up-vote this post, if you want it back.
Okay, might as well throw in, why I wanted this back, while I'm at it, the reason being, is because it was so much easier to find whatever it was I was looking for in the world, now, it's like: 'tag @e[type=item,nbt={Item:{id:"minecraft:sandstone"}}] add sandstone' and then 'execute as @e[tag=sandstone] at @s run (whatever command)' I mean, why does it have to be harder than it has to be?...
I assume you mean "/testfor" instead of "/lookfor".
/testfor would not have helped in the situation you are describing (neither in the quote nor to move blocks around). All it does is tell you that it found something. You cannot target what it found, which is primarily why it was useless for most situations. You'd have to use "/tag" (previously "/scoreboard players tag") instead anyways.
In 1.13, if you're only running one command (be it directly or the "/function" command), you can use the selector from /tag in /execute:
execute as @e[type=item,nbt={Item:{id:"minecraft:sandstone"}} at @s run ...
One of the few uses of /testfor was to mix it with CommandStats in order to count the number of entities that were found.
Thanks for the answer Skylinerw, Sorry, "testfor", so what that allowed me to do, was that I could for example look for someone flying, so I could do an anti-cheat for that, through command blocks, for my vanilla maps, that I made.
Not only that, you could do so much with it, like, apply effects, based on what blocks you were walking on, stop people from accessing areas, making a dev. door, that only the people I chose, was able to enter, look for changes in blocks, having it be an "invisible pressure plate" (just this in of it-self, is insanely powerful).
Couple a "testfor" command, with a comparator, and you could do so much great things, very easily, like, if you wanted it to do one thing if it found whatever it looked for, and another, if it wasn't true, and then couple that with an(some/loads of) and/nand gate(s), and you could do insanely interesting things.
So, this is why it doesn't make sense to remove it, because it was almost overpowered, in how it could be used, as long as you know, or try and figure out what it can be used for, 7 very powerful letters.
so what that allowed me to do, was that I could for example look for someone flying, so I could do an anti-cheat for that, through command blocks, for my vanilla maps, that I made.
/testfor is not what allowed you to do that. The selector in /testfor is. There is no point in using /testfor if you can use the selector elsewhere, hence why /execute's introduction rendered /testfor nearly useless.
I should reiterate that /testfor did not allow you to target the entities found by it. If you used /testfor to see if somebody is flying, then need to target the same player later on using the same selector, /testfor is an unnecessary step. You'd end up using the same selector elsewhere, so you might as well remove /testfor.
Not only that, you could do so much with it, like, apply effects, based on what blocks you were walking on, stop people from accessing areas, making a dev. door, that only the people I chose, was able to enter, look for changes in blocks, having it be an "invisible pressure plate" (just this in of it-self, is insanely powerful).
/testfor is not what allows you to do any of that. That's the selector at work, which you can use in /effect (which is what applies effects, not /testfor). /execute is what you'd use to check if a player is walking on a particular block type; you can't even use /testfor for that.
None of those things are dependent on /testfor's existence. For example, if you were run a command based on a particular player's name, you're going to be running a command after /testfor anyways. You would ditch /testfor and copy over its selector into /execute to cause the specific players to run a command that opens the door.
Couple a "testfor" command, with a comparator, and you could do so much great things, very easily, like, if you wanted it to do one thing if it found whatever it looked for, and another, if it wasn't true, and then couple that with an(some/loads of) and/nand gate(s), and you could do insanely interesting things.
These days you should not be using a comparator for a multitude of reasons (poor redstone performance, timing delay that can cause the comparator to be locked on, multiplayer-unfriendliness (primarily as a result of the delay)). Since 1.9, command blocks themselves were overhauled. You should be using conditional chain command blocks instead of comparators.
First, almost everything /testfor can do, /execute an do better. The only exception I can think about now is Fixed Position Dispenser Crafting, which is not common as Floor Crafting.
Second, there is a command replacing /testfor in minecraft 1.13: /execute if. It's much better than the old /testfor command, so what's the point of having that command?
Unfortunately, I can't repair or get my world back, where I used it, but I'm gonna try and recreate it, to show you, that it's not as bad as you think, given that you know how to use it, and what it really can be used for.
also, all I see here is just hate after hate, if "/execute" is so great, as you claim, I've yet to see ANY proof of this, none of you have said anything, but just fan-boying all over something, that's just insanely confusing to me...
So again, give me usable examples, lines of commands, that I could possibly use...
So, here's your challenge everyone, a maximum of 2 command blocks for each challenge:
Dev. door/invisible pressure plate:
An iron door, that opens, when I step into a specified area.
Effect blocks:
Each time I step on for example cobblestone, I'll get teleported, or I step on soulsand, and I get blindness and so on.
Anti cheat:
Anti-fly, anti-gamemode change, or anti-teleport
Sequencer:
A system that moves blocks according to what you do, like having a redstone block move, by for example pressing a button, that's not even close to the command block.
Remote redstone:
I press a button, that spawns a redstone block somewhere (basically sequencer).
Dropped item remover:
This should be self-explanatory
All of this I achieved with 2 command blocks each, well, anti-fly had 2, anti-gamemode had 2, and some others had separately 2.
So put your money, where you mouth is, prove to me, that it is superior, instead of just saying stuff, without any proof, what so ever, I'll do the same, once I get into it again, haven't really played with command blocks, since 1.11.2...
Up for the challenge? "/testfor" is superior, change my mind... if you're not, don't even bother answering, I don't wanna see anything, but lines of commands/codes, now.
Extra points if you make something that I couldn't make with the testfor mechanics(aka, have the execute command find something, that the testfor can't).
<block> and <block data> refer to the block you want to be in position to run the command in <command>.
With version 1.12.2, you have to summon an invisible armor stand tagged button where you wanna place the button first, so you might need 1 extra command block to summon.
Remote redstone:
See Sequencer
Dropped item remover:
1.13:
/execute at @e[type=item,nbt={}] run kill @e[sort=nearest,limit=1]
1.12.2:
/scoreboard players tag @e[type=item] add Kill <nbt>
/kill @e[tag=Kill]
Most of the commands need only 1 command block, except for version 1.12.2 of Squencer, Remote redstone and Dropped item remover, and Dev. door/invisible pressure plate.
And bonus point:
1.Floor Crafting:
You throw materials to the floor, and Boom! They turn into an item.
2.Thunder Bow:
You shot an arrow with a special bow, the it summon Lightning where it hit!
P/S: How can you make a Dropped item remover and Effect blocks system with only 2 command blocks with /testfor?
So, here's your challenge everyone, a maximum of 2 command blocks for each challenge:
I will start by pointing out that all of the below but the first one (which uses 2 commands, still meeting your challenge) uses only 1 command.
Dev. door/invisible pressure plate:
An iron door, that opens, when I step into a specified area.
/setblock X Y Z minecraft:iron_door[open=false]
/execute as @a[x=x,y=y,z=z,r=5,name=name] run setblock X Y Z minecraft:iron_door[open=true]
Effect blocks:
Each time I step on for example cobblestone, I'll get teleported, or I step on soulsand, and I get blindness and so on.
/testfor cannot even do that.
/execute as @a at @s if block ~ ~-1 ~ minecraft:cobblestone run teleport @s X Y Z
Or
/execute as @a at @s if block ~ ~-1 ~ minecraft:soulsand run effect give @s minecraft:blindness 1
Anti cheat:
Anti-fly, anti-gamemode change, or anti-teleport
Anti-fly and anti-teleport are too generic; what is the criteria for detection (flying in creative mode? Flying in survival mode? Flying with elytra? Teleporting with command? Teleporting with end gateway? Teleporting with spectator mode?) and what is the punishment? For anti-gamemode-change (assuming you mean locking players to, for example, survival mode), that has nothing to do with /testfor or /execute. Just use /gamemode:
/gamemode survival @a[gamemode=!survival]
Sequencer:
A system that moves blocks according to what you do, like having a redstone block move, by for example pressing a button, that's not even close to the command block.
/testfor could not test for button clicks in the first place. Luckily /execute can.
/execute if block X Y Z minecraft:stone_button[powered=true] run clone X Y Z X2 Y2 Z2 x y z replace move
Remote redstone:
I press a button, that spawns a redstone block somewhere (basically sequencer).
/testfor cannot test for button clicks. But you don't even need /execute for that (unless the detection itself is remote, in which case, see the previous command).
/setblock X Y Z minecraft:redstone_block
Dropped item remover:
This should be self-explanatory
This has nothing to do with /testfor or /execute. Just use /kill (or prior to 1.13, "/scoreboard players tag" and /kill):
Extra points if you make something that I couldn't make with the testfor mechanics(aka, have the execute command find something, that the testfor can't).
1.13, on the other hand, has vastly extended /execute's capabilities:
/execute as ...
/execute at ...
/execute positioned [x] [y] [z] ...
/execute positioned as [entity] ...
/execute facing [x] [y] [z] ...
/execute facing [entity] ...
/execute rotated [y] [x] ...
/execute rotated as [entity] ...
/execute in ...
/execute anchored ...
/execute if block ...
/execute if blocks ...
/execute if entity ... (in particular, does not change the command sender, allowing use of "as" alongside "if")
/execute if score ... (in particular, scores of fake players, which a selector cannot do)
/execute unless ...
/execute store result|success score ...
/execute store result|success block ...
/execute store result|success entity ...
/execute store result|success bossbar ...
haven't really played with command blocks, since 1.11.2...
You should have not been using /testfor too much since 1.8, though that was before the command block overhaul where there was still some reliance on comparators. Since 1.9 you should have essentially given it (and comparators) up entirely.
also, all I see here is just hate after hate, if "/execute" is so great, as you claim, I've yet to see ANY proof of this, none of you have said anything, but just fan-boying all over something, that's just insanely confusing to me...
instead of just saying stuff, without any proof, what so ever
Please refrain from such negative conduct. It does not help your case in any way and only serves to breed hostility for no gain. You asked us a question, and we answered it. If you wanted clarification or extensive examples, you should have simply asked for it.
/execute store result score time test run time query daytime
This stores the current time of the day in a scoreboard called 'test' under the name 'time'.
Before, you had to specifically query the daytime in a command block and then use commandStats to store the result of the command block in a scoreboard. This new command has the advantage that it can be run anywhere. In a command block, in a function and even just in the chatbox.
/execute if @a[x=,y=,z=,distance=..r] run setblock <x> <y> <z> <block>
can't filter multiple people, which doesn't make it a dev. door...
Skyliner:
/testfor cannot even do that.
/execute as @a at @s if block ~ ~-1 ~ minecraft:cobblestone run teleport @s X Y Z
Or
/execute as @a at @s if block ~ ~-1 ~ minecraft:soulsand run effect give @s minecraft:blindness 1
"/testforblock" I'm just gonna leave this here... not to prove you wrong or anything, but yeeeeah... <
/testfor could not test for button clicks in the first place. Luckily /execute can.
/execute if block X Y Z minecraft:stone_button[powered=true]
Again, just gonna leave "/testforblock" here... <
/testfor cannot test for button clicks. But you don't even need /execute for that (unless the detection itself is remote, in which case, see the previous command).
/setblock X Y Z minecraft:redstone_block
And yet again "/testforblock" seems highly apropriate here xD <
also, all I see here is just hate after hate, if "/execute" is so great, as you claim, I've yet to see ANY proof of this, none of you have said anything, but just fan-boying all over something, that's just insanely confusing to me...
instead of just saying stuff, without any proof, what so ever
Please refrain from such negative conduct. It does not help your case in any way and only serves to breed hostility for no gain. You asked us a question, and we answered it. If you wanted clarification or extensive examples, you should have simply asked for it.
I'm sorry, I didn't mean it to sound that bad, that you make it out to be, I'm not a native English speaker, so I have trouble expressing my-self properly at times, I'm sitting here translating on the fly, from Swedish.
Also: " < ", is meant to be like a joke, so that there's no more miss-understandings.
And
/execute as @a[x=x,y=y,z=z,r=5,name=name] run setblock X Y Z minecraft:iron_door[open=true]
"r=" = "unknown option 'r' "...
And
/execute as @a[x=14,y=56,z=58,name=FrozdY] run setblock 14 56 58 minecraft:iron_door[open=true]
or
/execute as @a[x=14,y=56,z=58,distance=3,name=FrozdY] run setblock 14 56 58 minecraft:iron_door[open=true]
doesn't even work, even though, it says, that it should, because I don't get any errors...
It's at Repeat, Unconditional and always active....
Extra points if you make something that I couldn't make with the testfor mechanics(aka, have the execute command find something, that the testfor can't).
nphhpn:
A dev door, is a door, that only the creator can go through, or open, based on the name you put into the command...
floor crafting:
"/testfor @e[{"item"}]"x2
"/give @p "item""
Thunder Bow:
IDK, but;
"/testfor @e[{"item"}]" blah blah blah, might work, I haven't done that before, since my adventures is usually movement based, like puzzles, parkour and so on...
Dropped item remover
I don't remember fully, bu I think:
"/testfor @e[{item}]" blah blah blah
Not entirely sure.
Effect block:
I can't remember, but it involves the use of:
"/testforblock" in a certain way, that I can't remember :/
How to kill the ingredients after giving the result?
Thunder Bow:
How to summon lightning where the arrow hit, not a fixed coordinate.
Dropped item remover:
Minecraft 1.12.2 does't support nbt tag in selector, so you need a /scoreboard command to specify the item, which cost 1 command block. /testfor need 1, and /kill need 1 more. So you need at least 3 command blocks using /testfor.
Btw, both /execute and /testfor are useless in this case in 1.12.2
How to kill the ingredients after giving the result?
Thunder Bow:
How to summon lightning where the arrow hit, not a fixed coordinate.
Dropped item remover:
Minecraft 1.12.2 does't support nbt tag in selector, so you need a /scoreboard command to specify the item, which cost 1 command block. /testfor need 1, and /kill need 1 more. So you need at least 3 command blocks using /testfor.
Btw, both /execute and /testfor are useless in this case in 1.12.2
I won't answer 6 or extra "challenge" just to prove you how /testfor is outdated.
Instead, here is one example. (yes, one is good enough to show how useless /testfor is)
Example: Kill all the on ground dropped item.
Before 1.13, If you use /testfor
First method
/testfor @e[type=item] {OnGround:1b}
[comparator]
/kill @e[type=item]
Second method
/testfor @e[type=item] {OnGround:1b}
[comparator]
/scoreboard players tag @e[type=item] add onground {OnGround:1b}
/kill @e[tag=onground]
There's absolutely a huge problem for the first method. All the other non-OnGround item will be kill together as long as one OnGround item was found.
In order to kill only the on ground ones, we have the second method to add tag and kill those will tag. It works now, but the /testfor doesn't do much here, it just restate the target selector and nbt tags, so why bother to use /testfor.
Without using testfor
Third...
/scoreboard players tag @e[type=item] add onground {OnGround:1b}
/kill @e[tag=onground]
In 1.13, /testfor is replaced by /execute, so now you just need one command to achieve this.
/kill @e[type=item,nbt={OnGround:1b}]
Of course if you prefer the /testfor+comparator way, where /execute is playing the exactly same role as /testfor in 1.12(but again...why detect it twice)
/execute if entity @e[type=item,nbt={OnGround:1b}]
[comparator]
/kill @e[type=item,nbt={OnGround:1b}]
Yes, /testfor and /testforblock are able to detect what you want, but what next?
What we are trying to tell you is that, what you found in /testfor doesn't really relate to whatever command you use, or chain. And this is the limit and the main problem for /testfor.
/testfor(testforblock,testforblocks) aren't removed. They are just replaced by /execute, because /execute can do the same, and better.
The difference between removed and replaced, hope you can understand that.
But hey, if you still prefer /testfor, that's fine. 1.12 is always there for you
/execute if entity @e[type=item,nbt={OnGround:1b}]
[comparator]
/kill @e[type=item,nbt={OnGround:1b}]
I never got the whole scoreboard-thing, it's way out of my comfort zone, when it comes to command blocks, I just have a question, how would you select a specific item, to "kill"?
I've tried to find the correct "@e[(usage)]", but, whatever I do, it ends up, in it either removing all items, or no items, The whole "@e"-thing as I remember it anyway, wasn't this complicated, the last time I used it, I believe anyway, I mean, how hard could it be to have it be like: "/kill @e[item=minecraft:coal,mob=zombie,neutral=cow,nbt='whatever this actually is']" and so on?
And another thing, is there any particular reason, to the "comparator", between those 2, couldn't you link them together, by making a conditional chain instead? Just asking, because I have to unlearn stuff, that was logical to me, and I grasped fully, to something new, and REALLY scary for me, because it's starting to look like real coding, instead of commands, me and coding doesn't play well together
I tried to make my own plugin once, and I couldn't even make something as simple as, removing fire spread, or block blacklisting, with clear instructions on how to even do it (I had this idiotic idea at one point, that I was gonna run a server, with plugins, that was made by only me, that meant, reinventing the wheel for security, rollback, selection, intricate settings, multiverse, travel, spreading of players, and so much more, which at the time seemed doable, till I actually started, and realized really quickly, that it wasn't even remotely viable... or even unlaughble...)
Thanks Ououn, these are actually really useful, given that they work, that is, I especially like the:
I never got the whole scoreboard-thing, it's way out of my comfort zone, when it comes to command blocks, I just have a question, how would you select a specific item, to "kill"?
I've tried to find the correct "@e[(usage)]", but, whatever I do, it ends up, in it either removing all items, or no items, The whole "@e"-thing as I remember it anyway, wasn't this complicated, the last time I used it, I believe anyway, I mean, how hard could it be to have it be like: "/kill @e[item=minecraft:coal,mob=zombie,neutral=cow,nbt='whatever this actually is']" and so on?
And another thing, is there any particular reason, to the "comparator", between those 2, couldn't you link them together, by making a conditional chain instead? Just asking, because I have to unlearn stuff, that was logical to me, and I grasped fully, to something new, and REALLY scary for me, because it's starting to look like real coding, instead of commands, me and coding doesn't play well together
I tried to make my own plugin once, and I couldn't even make something as simple as, removing fire spread, or block blacklisting, with clear instructions on how to even do it (I had this idiotic idea at one point, that I was gonna run a server, with plugins, that was made by only me, that meant, reinventing the wheel for security, rollback, selection, intricate settings, multiverse, travel, spreading of players, and so much more, which at the time seemed doable, till I actually started, and realized really quickly, that it wasn't even remotely viable... or even unlaughble...)
So, as the title says, why was the "lookfor" command so bad, that it had to be removed?...
Up-vote this post, if you want it back.
Okay, might as well throw in, why I wanted this back, while I'm at it, the reason being, is because it was so much easier to find whatever it was I was looking for in the world, now, it's like: 'tag @e[type=item,nbt={Item:{id:"minecraft:sandstone"}}] add sandstone' and then 'execute as @e[tag=sandstone] at @s run (whatever command)' I mean, why does it have to be harder than it has to be?...
All I want is, to easier move blocks around, and/or remove dropped blocks...
so, it would be appreciated, if someone could help me out with that, that is, moving blocks around, and removing dropped items.
Thank you.
I assume you mean "/testfor" instead of "/lookfor".
/testfor would not have helped in the situation you are describing (neither in the quote nor to move blocks around). All it does is tell you that it found something. You cannot target what it found, which is primarily why it was useless for most situations. You'd have to use "/tag" (previously "/scoreboard players tag") instead anyways.
In 1.13, if you're only running one command (be it directly or the "/function" command), you can use the selector from /tag in /execute:
One of the few uses of /testfor was to mix it with CommandStats in order to count the number of entities that were found.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Thanks for the answer Skylinerw, Sorry, "testfor", so what that allowed me to do, was that I could for example look for someone flying, so I could do an anti-cheat for that, through command blocks, for my vanilla maps, that I made.
Not only that, you could do so much with it, like, apply effects, based on what blocks you were walking on, stop people from accessing areas, making a dev. door, that only the people I chose, was able to enter, look for changes in blocks, having it be an "invisible pressure plate" (just this in of it-self, is insanely powerful).
Couple a "testfor" command, with a comparator, and you could do so much great things, very easily, like, if you wanted it to do one thing if it found whatever it looked for, and another, if it wasn't true, and then couple that with an(some/loads of) and/nand gate(s), and you could do insanely interesting things.
So, this is why it doesn't make sense to remove it, because it was almost overpowered, in how it could be used, as long as you know, or try and figure out what it can be used for, 7 very powerful letters.
I think Skylinerw explained well enough...
Since the day "execute" came out, I rarely used "testfor". And "testfor" is nearly useless in function.
OuOun, why is "execute", so much better, then? As a non-coder, it doesn't even remotely make sense to me, but "lookfor" is self-explanatory...
/testfor is not what allowed you to do that. The selector in /testfor is. There is no point in using /testfor if you can use the selector elsewhere, hence why /execute's introduction rendered /testfor nearly useless.
I should reiterate that /testfor did not allow you to target the entities found by it. If you used /testfor to see if somebody is flying, then need to target the same player later on using the same selector, /testfor is an unnecessary step. You'd end up using the same selector elsewhere, so you might as well remove /testfor.
/testfor is not what allows you to do any of that. That's the selector at work, which you can use in /effect (which is what applies effects, not /testfor). /execute is what you'd use to check if a player is walking on a particular block type; you can't even use /testfor for that.
None of those things are dependent on /testfor's existence. For example, if you were run a command based on a particular player's name, you're going to be running a command after /testfor anyways. You would ditch /testfor and copy over its selector into /execute to cause the specific players to run a command that opens the door.
These days you should not be using a comparator for a multitude of reasons (poor redstone performance, timing delay that can cause the comparator to be locked on, multiplayer-unfriendliness (primarily as a result of the delay)). Since 1.9, command blocks themselves were overhauled. You should be using conditional chain command blocks instead of comparators.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
First, almost everything /testfor can do, /execute an do better. The only exception I can think about now is Fixed Position Dispenser Crafting, which is not common as Floor Crafting.
Second, there is a command replacing /testfor in minecraft 1.13: /execute if. It's much better than the old /testfor command, so what's the point of having that command?
ewe
Unfortunately, I can't repair or get my world back, where I used it, but I'm gonna try and recreate it, to show you, that it's not as bad as you think, given that you know how to use it, and what it really can be used for.
also, all I see here is just hate after hate, if "/execute" is so great, as you claim, I've yet to see ANY proof of this, none of you have said anything, but just fan-boying all over something, that's just insanely confusing to me...
So again, give me usable examples, lines of commands, that I could possibly use...
So, here's your challenge everyone, a maximum of 2 command blocks for each challenge:
Dev. door/invisible pressure plate:
An iron door, that opens, when I step into a specified area.
Effect blocks:
Each time I step on for example cobblestone, I'll get teleported, or I step on soulsand, and I get blindness and so on.
Anti cheat:
Anti-fly, anti-gamemode change, or anti-teleport
Sequencer:
A system that moves blocks according to what you do, like having a redstone block move, by for example pressing a button, that's not even close to the command block.
Remote redstone:
I press a button, that spawns a redstone block somewhere (basically sequencer).
Dropped item remover:
This should be self-explanatory
All of this I achieved with 2 command blocks each, well, anti-fly had 2, anti-gamemode had 2, and some others had separately 2.
So put your money, where you mouth is, prove to me, that it is superior, instead of just saying stuff, without any proof, what so ever, I'll do the same, once I get into it again, haven't really played with command blocks, since 1.11.2...
Up for the challenge? "/testfor" is superior, change my mind... if you're not, don't even bother answering, I don't wanna see anything, but lines of commands/codes, now.
Extra points if you make something that I couldn't make with the testfor mechanics(aka, have the execute command find something, that the testfor can't).
Dev. door/invisible pressure plate:
1.13:
1.12.2:
x,y,z and r or distance specify the area, <x>, <y>, <z> refer to the position where you wanna place the block in the <block> part.
To close the door, just use /setblock command.
Effect blocks:
1.13:
1.12.2:
<block> and <block data> specify the block which gives effect, <command> give the effect.
Anti-cheat:
I've never do that before, but I think /op command might be the best.
Sequencer:
1.13:
1.12.2:
<block> and <block data> refer to the block you want to be in position to run the command in <command>.
With version 1.12.2, you have to summon an invisible armor stand tagged button where you wanna place the button first, so you might need 1 extra command block to summon.
Remote redstone:
See Sequencer
Dropped item remover:
1.13:
1.12.2:
Most of the commands need only 1 command block, except for version 1.12.2 of Squencer, Remote redstone and Dropped item remover, and Dev. door/invisible pressure plate.
And bonus point:
1.Floor Crafting:
You throw materials to the floor, and Boom! They turn into an item.
2.Thunder Bow:
You shot an arrow with a special bow, the it summon Lightning where it hit!
P/S: How can you make a Dropped item remover and Effect blocks system with only 2 command blocks with /testfor?
Changed your mind?
ewe
I will start by pointing out that all of the below but the first one (which uses 2 commands, still meeting your challenge) uses only 1 command.
/testfor cannot even do that.
Or
Anti-fly and anti-teleport are too generic; what is the criteria for detection (flying in creative mode? Flying in survival mode? Flying with elytra? Teleporting with command? Teleporting with end gateway? Teleporting with spectator mode?) and what is the punishment? For anti-gamemode-change (assuming you mean locking players to, for example, survival mode), that has nothing to do with /testfor or /execute. Just use /gamemode:
/testfor could not test for button clicks in the first place. Luckily /execute can.
/testfor cannot test for button clicks. But you don't even need /execute for that (unless the detection itself is remote, in which case, see the previous command).
This has nothing to do with /testfor or /execute. Just use /kill (or prior to 1.13, "/scoreboard players tag" and /kill):
1.8-1.12 is pretty clear-cut:
1.13, on the other hand, has vastly extended /execute's capabilities:
You should have not been using /testfor too much since 1.8, though that was before the command block overhaul where there was still some reliance on comparators. Since 1.9 you should have essentially given it (and comparators) up entirely.
Please refrain from such negative conduct. It does not help your case in any way and only serves to breed hostility for no gain. You asked us a question, and we answered it. If you wanted clarification or extensive examples, you should have simply asked for it.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Can I get the bonus points for this command?
/execute store result score time test run time query daytime
This stores the current time of the day in a scoreboard called 'test' under the name 'time'.
Before, you had to specifically query the daytime in a command block and then use commandStats to store the result of the command block in a scoreboard. This new command has the advantage that it can be run anywhere. In a command block, in a function and even just in the chatbox.
nphhpn:
/execute if @a[x=,y=,z=,distance=..r] run setblock <x> <y> <z> <block>
can't filter multiple people, which doesn't make it a dev. door...
Skyliner:
/testfor cannot even do that.
"/testforblock" I'm just gonna leave this here... not to prove you wrong or anything, but yeeeeah... <
/testfor could not test for button clicks in the first place. Luckily /execute can.
Again, just gonna leave "/testforblock" here... <
/testfor cannot test for button clicks. But you don't even need /execute for that (unless the detection itself is remote, in which case, see the previous command).
And yet again "/testforblock" seems highly apropriate here xD <
Please refrain from such negative conduct. It does not help your case in any way and only serves to breed hostility for no gain. You asked us a question, and we answered it. If you wanted clarification or extensive examples, you should have simply asked for it.
I'm sorry, I didn't mean it to sound that bad, that you make it out to be, I'm not a native English speaker, so I have trouble expressing my-self properly at times, I'm sitting here translating on the fly, from Swedish.
Also: " < ", is meant to be like a joke, so that there's no more miss-understandings.
And
/execute as @a[x=x,y=y,z=z,r=5,name=name] run setblock X Y Z minecraft:iron_door[open=true]
"r=" = "unknown option 'r' "...
And
/execute as @a[x=14,y=56,z=58,name=FrozdY] run setblock 14 56 58 minecraft:iron_door[open=true]
or
/execute as @a[x=14,y=56,z=58,distance=3,name=FrozdY] run setblock 14 56 58 minecraft:iron_door[open=true]
doesn't even work, even though, it says, that it should, because I don't get any errors...
It's at Repeat, Unconditional and always active....
So what exactly is a dev door?
And you didn't answer those yet...
ewe
nphhpn:
A dev door, is a door, that only the creator can go through, or open, based on the name you put into the command...
floor crafting:
"/testfor @e[{"item"}]"x2
"/give @p "item""
Thunder Bow:
IDK, but;
"/testfor @e[{"item"}]" blah blah blah, might work, I haven't done that before, since my adventures is usually movement based, like puzzles, parkour and so on...
Dropped item remover
I don't remember fully, bu I think:
"/testfor @e[{item}]" blah blah blah
Not entirely sure.
Effect block:
I can't remember, but it involves the use of:
"/testforblock" in a certain way, that I can't remember :/
Floor Crafting:
How to kill the ingredients after giving the result?
Thunder Bow:
How to summon lightning where the arrow hit, not a fixed coordinate.
Dropped item remover:
Minecraft 1.12.2 does't support nbt tag in selector, so you need a /scoreboard command to specify the item, which cost 1 command block. /testfor need 1, and /kill need 1 more. So you need at least 3 command blocks using /testfor.
Btw, both /execute and /testfor are useless in this case in 1.12.2
ewe
How was /execute useless in 1.12 in that case?
==Links==
๐๐๐๐จ๐ง๐ ๐๐ก๐๐ง๐ง๐๐ฅ- https://www.youtube.com/channel/UCQYroXqdZtYBnyspneetBGA/featured
๐๐ง๐ฌ๐ญ๐๐ ๐ซ๐๐ฆ- https://www.instagram.com/cowsdabest_yt/?hl=en
๐๐ฐ๐ข๐ญ๐ญ๐๐ซ- https://twitter.com/cowsdabestyt
๐๐ข๐ฌ๐๐จ๐ซ๐- https://discord.gg/H2NfhpQ
==DISCLAIMER!==
Please credit me if you are going to use it in a video or a map!
Because only 1 /kill commamd is enough for a Dropper item remover. So why need /execute?
ewe
I won't answer 6 or extra "challenge" just to prove you how /testfor is outdated.
Instead, here is one example. (yes, one is good enough to show how useless /testfor is)
Example: Kill all the on ground dropped item.
Before 1.13, If you use /testfor
First method
/testfor @e[type=item] {OnGround:1b}
[comparator]
/kill @e[type=item]
Second method
/testfor @e[type=item] {OnGround:1b}
[comparator]
/scoreboard players tag @e[type=item] add onground {OnGround:1b}
/kill @e[tag=onground]
There's absolutely a huge problem for the first method. All the other non-OnGround item will be kill together as long as one OnGround item was found.
In order to kill only the on ground ones, we have the second method to add tag and kill those will tag. It works now, but the /testfor doesn't do much here, it just restate the target selector and nbt tags, so why bother to use /testfor.
Without using testfor
Third...
/scoreboard players tag @e[type=item] add onground {OnGround:1b}
/kill @e[tag=onground]
In 1.13, /testfor is replaced by /execute, so now you just need one command to achieve this.
/kill @e[type=item,nbt={OnGround:1b}]
Of course if you prefer the /testfor+comparator way, where /execute is playing the exactly same role as /testfor in 1.12(but again...why detect it twice)
/execute if entity @e[type=item,nbt={OnGround:1b}]
[comparator]
/kill @e[type=item,nbt={OnGround:1b}]
Yes, /testfor and /testforblock are able to detect what you want, but what next?
What we are trying to tell you is that, what you found in /testfor doesn't really relate to whatever command you use, or chain. And this is the limit and the main problem for /testfor.
/testfor(testforblock,testforblocks) aren't removed. They are just replaced by /execute, because /execute can do the same, and better.
The difference between removed and replaced, hope you can understand that.
But hey, if you still prefer /testfor, that's fine. 1.12 is always there for you
Thanks Ououn, these are actually really useful, given that they work, that is, I especially like the:
I never got the whole scoreboard-thing, it's way out of my comfort zone, when it comes to command blocks, I just have a question, how would you select a specific item, to "kill"?
I've tried to find the correct "@e[(usage)]", but, whatever I do, it ends up, in it either removing all items, or no items, The whole "@e"-thing as I remember it anyway, wasn't this complicated, the last time I used it, I believe anyway, I mean, how hard could it be to have it be like: "/kill @e[item=minecraft:coal,mob=zombie,neutral=cow,nbt='whatever this actually is']" and so on?
And another thing, is there any particular reason, to the "comparator", between those 2, couldn't you link them together, by making a conditional chain instead? Just asking, because I have to unlearn stuff, that was logical to me, and I grasped fully, to something new, and REALLY scary for me, because it's starting to look like real coding, instead of commands, me and coding doesn't play well together
I tried to make my own plugin once, and I couldn't even make something as simple as, removing fire spread, or block blacklisting, with clear instructions on how to even do it (I had this idiotic idea at one point, that I was gonna run a server, with plugins, that was made by only me, that meant, reinventing the wheel for security, rollback, selection, intricate settings, multiverse, travel, spreading of players, and so much more, which at the time seemed doable, till I actually started, and realized really quickly, that it wasn't even remotely viable... or even unlaughble...)
You could do:
/kill @e[type=item,nbt={Item:{id:"minecraft:coal"}}]
For item killing
And Yes, you can just put the conditional. And you can also do /kill @e[type=item,nbt={OnGround:1b}] This will kill all ground items
==Links==
๐๐๐๐จ๐ง๐ ๐๐ก๐๐ง๐ง๐๐ฅ- https://www.youtube.com/channel/UCQYroXqdZtYBnyspneetBGA/featured
๐๐ง๐ฌ๐ญ๐๐ ๐ซ๐๐ฆ- https://www.instagram.com/cowsdabest_yt/?hl=en
๐๐ฐ๐ข๐ญ๐ญ๐๐ซ- https://twitter.com/cowsdabestyt
๐๐ข๐ฌ๐๐จ๐ซ๐- https://discord.gg/H2NfhpQ
==DISCLAIMER!==
Please credit me if you are going to use it in a video or a map!