From the Super Mario Wiki
Retrieved from "https://www.mariowiki.com/index.php?title=Yūrei&oldid=2431628"
As it appears to be a ghost, Yūrei cannot be attacked or defeated by Wario, nor can it hurt Wario. It will attempt to steal any type of loose Coin on the ground, but will not steal Blue or Red Crystals or Diamonds that float in the air. When Wario has Keyzer (the ghost-like creature needed to progress to the next stage), Yūrei will steal it instead, locking all doors and laughing until Wario recovers it.
The name Yurei refers to figures in Japanese folklore that are analogous to Western legends of ghosts.