java.lang.Object
me.andreasmelone.glowingeyes.neoforge.common.packets.PacketHandler

public class PacketHandler extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    registerPackets(net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent event)
     
    static void
    send(net.minecraft.network.protocol.common.custom.CustomPacketPayload packet)
    Sends a packet to the server.
    static void
    send(net.minecraft.server.level.ServerPlayer target, net.minecraft.network.protocol.common.custom.CustomPacketPayload packet)
    Sends a packet to a certain receiver/target.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PacketHandler

      public PacketHandler()
  • Method Details

    • registerPackets

      public static void registerPackets(net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent event)
    • send

      public static void send(net.minecraft.server.level.ServerPlayer target, net.minecraft.network.protocol.common.custom.CustomPacketPayload packet)
      Sends a packet to a certain receiver/target. This method is server-only!!!
      Parameters:
      target - The target to receive the packet
      packet - The packet to send
    • send

      public static void send(net.minecraft.network.protocol.common.custom.CustomPacketPayload packet)
      Sends a packet to the server. This method is client-only!!!
      Parameters:
      packet - The packet to send