Class PacketEvent

java.lang.Object
org.polyfrost.oneconfig.api.event.v1.events.Event.Cancellable
org.polyfrost.oneconfig.api.event.v1.events.PacketEvent
All Implemented Interfaces:
Event
Direct Known Subclasses:
PacketEvent.Receive, PacketEvent.Send

public abstract class PacketEvent extends Event.Cancellable
  • Constructor Details

    • PacketEvent

      public PacketEvent(Object packet)
  • Method Details

    • getPacket

      public <T> T getPacket()
      Due to differences across Minecraft versions, this is a Duck method, meaning that it will return the expected type for that minecraft version.
      • For legacy forge, this will be a IPacket.
      • For modern forge, this will be a Packet.
      • For fabric, this will be a Packet.
    • component1

      public Object component1()