SHOW:
|
|
- or go back to the newest paste.
| 1 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) | |
| 2 | - | public void onBlockPlace(final BlockPlaceEvent event) {
|
| 2 | + | public void onBlockPlace(BlockPlaceEvent event) {
|
| 3 | Block blockPlaced = event.getBlockPlaced(); | |
| 4 | // Just mob spawner events | |
| 5 | if (blockPlaced.getType() != Material.MOB_SPAWNER) return; | |
| 6 | BlockState state = blockPlaced.getState(); | |
| 7 | if ((state instanceof CreatureSpawner)) {
| |
| 8 | CreatureSpawner spawner = (CreatureSpawner) state; | |
| 9 | spawner.setSpawnedType(EntityType.COW); | |
| 10 | } | |
| 11 | } |