In Minecraft 1.9, there is a simple way to do it without scoreboards using Chain Command Blocks. For demonstration, I will kill all entities that are not players or items.
First Command Block: execute @e ~ ~ ~ summon ArmorStand ~ ~ ~ {Invisible:1,NoGravity:1}
This makes an armor stand in the same spot as every entity. The first command block must be facing into the second command block.
Second Command Block: execute @e[type=Player] ~ ~ ~ kill @e[type=ArmorStand,c=1]
This makes all players kill the armor stands that are about to do something.
Third Command Block: execute @e[type=Item] ~ ~ ~ kill @e[type=ArmorStand,c=1]
Same as above except with players. You can do this as many times as you want.
Last Command Block: execute @e[type=ArmorStand] ~ ~ ~ kill @e[c=2] ~ ~ ~
This makes all armor stands kill themselves and the entity they represented.
The advantages:
- Uses armor stands. Why not?
- Doesn't require scoreboards
The disadvantages:
- If an entity dies/teleports to a far location after the armor stand is summoned but before the armor stands run their commands, some entity that isn't meant to be killed will be killed
If you want all of the non-player non-item entities to run a command, just use this:
Last Command Block: execute @e[type=ArmorStand] ~ ~ ~ execute @e[r=1,c=-1] ~ ~ ~ <command>
Disadvantages to this:
- If an entity dies/teleports/leaves the range in under 1ms, the armor stand will execute the command itself