Class MinecraftConnection

java.lang.Object
com.cryptomorin.xseries.reflection.minecraft.MinecraftConnection

public final class MinecraftConnection extends Object
Provides general packet-related API for players.

Clientbound Packets are considered fake updates to the client without changing the actual data. Since all the data is handled by the server.

  • Field Details

  • Constructor Details

    • MinecraftConnection

      public MinecraftConnection()
  • Method Details

    • getHandle

      @NotNull public static @NotNull Object getHandle(@NotNull @NotNull org.bukkit.entity.Player player)
    • getConnection

      @Nullable public static @Nullable Object getConnection(@NotNull @NotNull org.bukkit.entity.Player player)
      Returns:
      null if the player is no longer online.
    • sendPacket

      @NotNull public static void sendPacket(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Object... packets)
      Sends a packet to the player asynchronously if they're online. Packets are thread-safe.
      Parameters:
      player - the player to send the packet to.
      packets - the packets to send.
      Since:
      1.0.0