I didn't see anything of checking for number of mobs using Comparators on the wiki.
--------------------------------------------------------------------------------------------------------
My suggestion is when using Comparators, you can check for the number of mobs when a pressure plate (of any type) is attached to a Comparator without using a Command Block with a /testfor command.
So here, when 5 sheep are on the pressure plate hooked up to a comparator, it will send a signal to the Dropper, and quickly dispense the item. When all of the sheep goes out, the comparator's signal will go lower and lower until the dropper is unable to dispense all of the items anymore.
But the problem here is you need to put a fence around the 5 sheep so that they can keep powering the comparator. The signal strength depends on the number of mobs on the pressure plate.
Five minecarts are holding 1 sheep per minecart. If the minecarts roll over a detector rail, the Comparator will count how many sheep are there in the mine cart train, and of course, send a signal to the dropper to dispense the item. The signal strength also depends on the number of minecarts containing sheep.
There's only 1 Minecart holding 1 sheep. To power the Dropper here, the minecart must roll over the detector rail to activate the comparator so that it will send the signal to the repeater and then power the redstone wire to activate the dropper. No repeater = cannot be powered.
Checking the number of times the pressure plate is pressed: - Player - Pressure Plate - Comparator - Powered redstone - Dropper (or dispenser) - Command Block - Any Block
You can also use a Command Block with the /scoreboard command to check how many times the pressure plate is stepped on. The player steps on the pressure plate 10 times. The Command Block will say:
"Number of Pressure Plate Steps: 10 -> Signal strength: 10"
Now it will power the comparator, and the signal strength is 10, and the dropper will fire the item upwards. When a Pressure Plate is stepped 15 times, you get the max power level. But if the player steps over 15 times, the signal strength will still be 15.
NOTE: This works for mobs which are over 1 block high though.
I love this idea.
Try giving constructive criticism and giving +1 rep so that you can support the idea. If you don't like it, give constructive criticism instead.
You can make a minecart train with 5 minecarts containing sheep. When the minecarts roll over the Detector Rail, the comparator will count the number of sheep in the minecarts, and that means the signal strength will be 5, and it will power the dropper.
What about using /scoreboard to check how many times a pressure plate is activated? Have mobs be pushed up via water and then every time a mob steps on the pressure plate, increase the score by one and then use a piston to push the mob off the plate to prevent it triggering twice. This would only work for mobs over 1 block high though
You could then use /testfor with a command block hooked up to a comparator, which would output the amount of mobs that have stood on the plate. This method already works in 1.5/1.5.1
Still, this suggestion does not use the Command Block.
--------------------------------------------------------------------------------------------------------
My suggestion is when using Comparators, you can check for the number of mobs when a pressure plate (of any type) is attached to a Comparator without using a Command Block with a /testfor command.
Schematic:
So here, when 5 sheep are on the pressure plate hooked up to a comparator, it will send a signal to the Dropper, and quickly dispense the item. When all of the sheep goes out, the comparator's signal will go lower and lower until the dropper is unable to dispense all of the items anymore.
But the problem here is you need to put a fence around the 5 sheep so that they can keep powering the comparator. The signal strength depends on the number of mobs on the pressure plate.
Minecart Schematic:
Five minecarts are holding 1 sheep per minecart. If the minecarts roll over a detector rail, the Comparator will count how many sheep are there in the mine cart train, and of course, send a signal to the dropper to dispense the item. The signal strength also depends on the number of minecarts containing sheep.
Minecart Schematic 2:
There's only 1 Minecart holding 1 sheep. To power the Dropper here, the minecart must roll over the detector rail to activate the comparator so that it will send the signal to the repeater and then power the redstone wire to activate the dropper. No repeater = cannot be powered.
Checking the number of times the pressure plate is pressed:
You can also use a Command Block with the /scoreboard command to check how many times the pressure plate is stepped on. The player steps on the pressure plate 10 times. The Command Block will say:
"Number of Pressure Plate Steps: 10 -> Signal strength: 10"
Now it will power the comparator, and the signal strength is 10, and the dropper will fire the item upwards. When a Pressure Plate is stepped 15 times, you get the max power level. But if the player steps over 15 times, the signal strength will still be 15.
NOTE: This works for mobs which are over 1 block high though.
--------------------------------------------------------------------------------------------------------
I love this idea.
Try giving constructive criticism and giving +1 rep so that you can support the idea. If you don't like it, give constructive criticism instead.
Anyways, i support.
You can make a minecart train with 5 minecarts containing sheep. When the minecarts roll over the Detector Rail, the comparator will count the number of sheep in the minecarts, and that means the signal strength will be 5, and it will power the dropper.
Good idea. Adding this.
Still, this suggestion does not use the Command Block.
Note that mobs can't be used with weighted pressure plates, it's for dropped items.