Skip to content
Hakan Kargın edited this page Apr 19, 2022 · 5 revisions

How To Use

Packet System

You can easily send packets to specific players or listen packets.

Examples

How to send a packet to player

HCore.sendPacket(player, new PacketPlayOutArmAnimation()); // sends PacketPlayOutArmAnimation() packet to player

HCore.sendPacket(player, new PacketPlayInAdvancements()); // sends PacketPlayInAdvancements() packet to player

How to listen of any packet

@EventHandler
public void onPacketEvent(@Nonnull PacketEvent event) {
    PacketPlayInAbilities packet = event.getPacket(); // gets packet as template
    System.out.println(packet.a()); // prints "a" method in PacketPlayInAbilities.
}
Clone this wiki locally