I'm trying to use /execute as @p{distance=..3] run give minecraft:minecart, but every time I do that it uses my gamertag as the command block name despite the fact that I renamed the block. The only way I can think of to fix this is using a testfor command with one block and a repeater into a named command block with the give command, but of course testfor has been removed. It'd also be nice to figure out how to use /execute to only send out a redstone signal when detecting players. That way I could do things like detect a certain player in a radius, have a repeated coming out of that block, and connect it to a trail of redstone so I could remotely open an iron door without buttons, levers, pressure plates, etc.
I'm trying to use /execute as @p{distance=..3] run give minecraft:minecart, but every time I do that it uses my gamertag as the command block name despite the fact that I renamed the block. The only way I can think of to fix this is using a testfor command with one block and a repeater into a named command block with the give command, but of course testfor has been removed. It'd also be nice to figure out how to use /execute to only send out a redstone signal when detecting players. That way I could do things like detect a certain player in a radius, have a repeated coming out of that block, and connect it to a trail of redstone so I could remotely open an iron door without buttons, levers, pressure plates, etc.
It's a little bit (actually, not a little bit...) unclear what you're trying to do.
Is your objective opening an iron door when a player gets nearby? Or do you just want us to fix a faulty command?
I'm trying to use /execute as @p{distance=..3] run give minecraft:minecart, but every time I do that it uses my gamertag as the command block name despite the fact that I renamed the block. The only way I can think of to fix this is using a testfor command with one block and a repeater into a named command block with the give command, but of course testfor has been removed. It'd also be nice to figure out how to use /execute to only send out a redstone signal when detecting players. That way I could do things like detect a certain player in a radius, have a repeated coming out of that block, and connect it to a trail of redstone so I could remotely open an iron door without buttons, levers, pressure plates, etc.
It's a little bit (actually, not a little bit...) unclear what you're trying to do.
Is your objective opening an iron door when a player gets nearby? Or do you just want us to fix a faulty command?
To test for players use:
and it will work just like /testfor
Command block engineer // Developer // #TeamTrees
Some of my projects:
https://www.curseforge.com/members/megacrafter1077/projects
https://datapackcenter.com/projects/adventure.104/
My tutorials:
https://datapackcenter.com/projects/data-pack-basics.71/
https://datapackcenter.com/projects/loot-tables.72/
https://datapackcenter.com/projects/custom-crafting-tutorial.70/
https://datapackcenter.com/projects/custom-item-models-tutorial.69/
https://datapackcenter.com/projects/raycasting-tutorial.68/
In addition to this, you would need to have a command to run at the end. So if you only wanted to test you could do the following:
This works because the /help command does nothing when run by a command block.
Edit: After testing this I found that this isn't the case. The original command is correct.
You don't need anything at the end, if there is no command at the end, it will only output a signal
Command block engineer // Developer // #TeamTrees
Some of my projects:
https://www.curseforge.com/members/megacrafter1077/projects
https://datapackcenter.com/projects/adventure.104/
My tutorials:
https://datapackcenter.com/projects/data-pack-basics.71/
https://datapackcenter.com/projects/loot-tables.72/
https://datapackcenter.com/projects/custom-crafting-tutorial.70/
https://datapackcenter.com/projects/custom-item-models-tutorial.69/
https://datapackcenter.com/projects/raycasting-tutorial.68/