namespace Minecraft.Server.FourKit.Event.Player; using Minecraft.Server.FourKit.Entity; /// /// Holds information for player teleport events. /// public class PlayerTeleportEvent : PlayerMoveEvent { /// /// Represents the cause of a player teleportation. /// public enum TeleportCause { /// Indicates the teleportation was caused by a player throwing an Ender Pearl. ENDER_PEARL, /// Indicates the teleportation was caused by a player executing a command. COMMAND, /// Indicates the teleportation was caused by a plugin. PLUGIN, /// Indicates the teleportation was caused by a player entering a Nether portal. NETHER_PORTAL, /// Indicates the teleportation was caused by a player entering an End portal. END_PORTAL, /// Indicates the teleportation was caused by an event not covered by this enum. UNKNOWN, } private readonly TeleportCause _cause; internal PlayerTeleportEvent(Player player, Location from, Location to) : this(player, from, to, TeleportCause.UNKNOWN) { } internal PlayerTeleportEvent(Player player, Location from, Location to, TeleportCause cause) : base(player, from, to) { _cause = cause; } /// /// Gets the cause of this teleportation event. /// /// The cause of the event. public TeleportCause getCause() => _cause; }