RailRide

public final class RailRide implements Listener

Seats a player in a packet-only minecart that drives itself along connected rails, starting in the direction the player faces. Sneaking, the end of the track or anything else moving the player gets them off, and the minecart disappears with the ride. The owner calls tick every tick.

Functions

Link copied to clipboard
public void close()
Gets the rider off where the minecart is.
Link copied to clipboard
public void death(PlayerDeathEvent event)
Link copied to clipboard
public void quit(PlayerQuitEvent event)
Link copied to clipboard
public void sneak(PlayerToggleSneakEvent event)
Link copied to clipboard
public static RailRide start(Plugin owner, Player rider, double speed)
Starts a ride when the player stands on a rail.
Link copied to clipboard
public void teleport(PlayerTeleportEvent event)
The teleport itself places the rider; the minecart only has to go before it lands.
Link copied to clipboard
public boolean tick()
Advances the minecart by one tick.