They were added in the 1.23: The Arsenal Update.
Ninja’s come in either white or black and will only spawn at night. Ninja’s weild shurikens, staffs, ninjatos, kamas, kusari-fundos,nunchakus, spears, and kusari-gamas.White Ninjas are neutral and will not attack anyone unless being attacked. Black Ninja’s are only hostile towards White Ninja, as well as the player. They are neutral to other mobs, only attacking them if provoked. Both types are 5x faster than a player and can jump up 10x higher than a player, which allows them to jump onto treetops and roofs of village houses. Black Ninja and White Ninja often get into conflict, you could see them fighting if your out at night. Undead mobs will not attack ninja. TIP: A great way to avoid black ninjas is to have a full set of black-died leather armor. This will make it so black ninja think you are part of them and will not attack you. All ninja have 18 HP.