This is a problem that appeared in 1.13 but it's still active in 1.14.
In older versions you could attach a comparator to a /testfor command block and it would output a redstone signal equal to the number of entities it detected. Now with the /exectute if @e eccetera it just gives you a true/false boolean value (1 signal or 0 signal).
Is there a way to detect the number of entities found and use it with the new syntax?
This is a problem that appeared in 1.13 but it's still active in 1.14.
In older versions you could attach a comparator to a /testfor command block and it would output a redstone signal equal to the number of entities it detected. Now with the /exectute if @e eccetera it just gives you a true/false boolean value (1 signal or 0 signal).
Is there a way to detect the number of entities found and use it with the new syntax?
of course, there is.
for example, if you want to store the number of sheep in the chunks around you into a scoreboard objective, you would do:
/scoreboard objectives add sheep dummy
and then count the sheep
/execute store result score <player> sheep run execute if entity @e[type=minecraft:sheep]
this will store the number of sheep around you into the players objective "sheep"
If you don't want the player having the score of the amount of sheep, make either a fake player (You can make one by just naming a random name on /execute store result score <player>) or use a tagged armor stand
This is a problem that appeared in 1.13 but it's still active in 1.14.
In older versions you could attach a comparator to a /testfor command block and it would output a redstone signal equal to the number of entities it detected. Now with the /exectute if @e eccetera it just gives you a true/false boolean value (1 signal or 0 signal).
Is there a way to detect the number of entities found and use it with the new syntax?
Sincerely yours,
Fether.
of course, there is.
for example, if you want to store the number of sheep in the chunks around you into a scoreboard objective, you would do:
and then count the sheep
this will store the number of sheep around you into the players objective "sheep"
Command block engineer // Developer // #TeamTrees
If you don't want the player having the score of the amount of sheep, make either a fake player (You can make one by just naming a random name on /execute store result score <player>) or use a tagged armor stand