/give @p spawner{BlockEntityTag:{SpawnData:{id:horse}} }
Issue: command results in a mob spawner that will spawn in the horse once and then turn into a pig spawner.
To fix this I recommend checking if it's instanceof a tile entity mob spawner then clearing it's spawn potentials. Or better yet use and create an interface called IPlaceTile which on placing the tile the tile entity can override it and do it itself.
Related issues
duplicates
Comments
No comments.