.setCancelled(true) does not cancel PlayerTeleportEvent when a player teleports via left clicking an entity in spectator mode to spectate it.
For example:
@EventHandler public void onSpectateTeleport(PlayerTeleportEvent event ) {
if(event.getCause() == (PlayerTeleportEvent.TeleportCause.SPECTATE))
}
only results in "test" being sent in chat to the player but the event is not canceled. The player still spectates the entity left-clicked.