title: Detecting when a player leaves a projectile and then removing entity
body: <p>I am building a 1.8.8 Bukkit/Spigot plugin that allows you to ride ender pearls and am stuck at detecting a dismount and removing the pearl. I have tried to catch the event but it doesn’t compile. I need a way to remove the pearl when there is a dismount. Thank you!</p>
  <pre><code>package damotheryeeter.general.enderpearlride.events;
  
  import org.bukkit.entity.Player;
  import static org.bukkit.Material.ENDER_PEARL;
  import org.bukkit.entity.EntityType;
  import org.bukkit.event.EventHandler;
  import org.bukkit.event.Listener;
  import org.bukkit.event.entity.ProjectileLaunchEvent;
  import org.bukkit.inventory.ItemStack;
  
  public class EnderThrowEvent implements Listener {
  @EventHandler
  public void onThrow(final ProjectileLaunchEvent e) {
      if (e.getEntityType().equals(EntityType.ENDER_PEARL)) {
          if (!(e.getEntity().getShooter() instanceof Player)) return;
          if (((Player) e.getEntity().getShooter()).hasPermission(&quot;enderpearlride.ride&quot;)) {
              e.getEntity().setPassenger((Player) e.getEntity().getShooter());
              if (((Player) e.getEntity().getShooter()).hasPermission(&quot;enderpearlride.infinite&quot;)) {
                  final Player p = (Player) e.getEntity().getShooter();
                  final ItemStack[] pearl = {new ItemStack(ENDER_PEARL, 1)};
                  p.getInventory().addItem(pearl);                
              }
          }
      }
  }
  </code></pre>