Packets

hCore provides you packet system. You can send packets to players and listen it.

HCore#sendPacket(player, packet)

Will send provided packet to player.

Handling packets

Example packet handling method's code:

@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.
}

Last updated