@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = false)
	private void onPlayerInteract(PlayerInteractEvent event) {
		if (!event.hasBlock()) {
			return;
		}

		Block clicked = event.getClickedBlock();
		Player player = event.getPlayer();

		// if a mob spawner was clicked
		if (clicked.getType().equals(Material.MOB_SPAWNER)) {

			// check permission for spawner eggs
			ItemStack itemInHand = null;
			PlayerInventory playerInv = player.getInventory();
			if (playerInv.getItemInMainHand().getType().equals(Material.MONSTER_EGG)) {

				itemInHand = playerInv.getItemInMainHand();

			} else if (playerInv.getItemInOffHand().getType().equals(Material.MONSTER_EGG)) {

				itemInHand = playerInv.getItemInOffHand();

			} else if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {

				// allow right-clicking a spawner to get the name of it
				if (player.hasPermission("spawner.get")) {

					CreatureSpawner csBlock = (CreatureSpawner) clicked.getState();

					// formatted name
					String spawnerName = SpawnerType.getTextFromType(SpawnerType.fromEntityType(csBlock.getSpawnedType()));

					Main.language.sendMessage(player, Main.language.getText(Keys.SpawnerType, spawnerName));
				}
			}

			if (itemInHand != null) {

				String eggId = SpawnerFunctions.getEntityNameFromSpawnEgg(itemInHand);

				Spawner spawner = SpawnerFunctions.makeSpawner(eggId);
				String spawnerName = spawner.getEntityName();

				if (!player.hasPermission("spawner.eggs.all") && !player.hasPermission("spawner.eggs." + spawnerName.toLowerCase())) {
					Main.language.sendMessage(player, Main.language.getText(Keys.NoPermission));
					event.setCancelled(true);

				} else {
					// formatted name
					spawnerName = SpawnerType.getTextFromName(eggId);
					Main.language.sendMessage(player, Main.language.getText(Keys.SpawnerChangedTo, spawnerName));
				}
			}
		}
	}