Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The TeleportListener class from the Telejecter project.
package com.me.rmsy.telejecter;
import org.bukkit.Location;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerTeleportEvent;
public class TeleportListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerTeleport(PlayerTeleportEvent event) {
Player player = event.getPlayer();
if(player.isInsideVehicle()){
Location xyz = event.getTo();
event.setCancelled(true);
player.eject();
player.teleport(xyz);
}
}
}
@SuperSpyTX

java public void playerTeleport(PlayerTeleportEvent event) {
shouldn't be
java public void onPlayerTeleport(PlayerTeleportEvent event) {

@rmsy
Owner

@SuperSpyTX Thanks, broskies :beer:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.