Minecraft – Command Block : Testing For Entities

minecraft-commandsminecraft-java-edition

This might not be possible, but i wanted to see if anybody had an answer before i tried something else.

So in one of my worlds, i have a Minecart Command block which, gets triggered as it rides round a track, but is there a way to actually Test For it existing?

I have tried /testfor @e[type=MinecartCommandBlock]

But it just outputs[00:44:19] Unknown command. Try /help for a list of commands. When it works just fine in the in-game console:
Found entity.Minecart.Command.Block.name

Does anybody know a way to solve or know of a way around this?

Best Answer

This command should work. If the time is always the same in the output and doesn't change, the command might be succeeding but not outputting to the console. Try using a comparator directly next to the command block to check whether it is finding the Minecart Command Block. If the comparator is lit, the command is succeeding. If the comparator is not lit, the command is either incorrect or the block could not find the entity you're looking for. If it continues outputting

[00:44:19] Unknown command. Try /help for a list of commands

then try opening the command block, pressing CTRL + A to highlight all, then pressing CTRL + C to copy. Next, break the block and place a new one, then open this new block and do CTRL + V to paste. Sometimes when I have this problem it helps to "reset" the block in this way.