Knife Guy (enemy)
From the Super Mario Wiki
Most Knife Guys are encountered normally on Yoshi's path, but some appear from behind shōji-like doors. They carry knife-like blades, which they point in front of them while running. When they bump into a wall or another Knife Guy, or simply encounter a platform's edge, they stop for a short time before turning the other way and continuing to scurry. Yoshi receives damage if he gets run into by a Knife Guy, although he can defeat the enemies by using any attack method.