A monster spawner can be obtained in Creative mode by taking it from Creative inventory, by using the /give command, or by using pick block. It is initially empty and inert, but can be configured to spawn a desired mob by using a spawn egg on the placed block.