-
Notifications
You must be signed in to change notification settings - Fork 19
Packet
Hakan Kargın edited this page Apr 19, 2022
·
5 revisions
You can easily send packets to specific players or listen packets.
HCore.sendPacket(player, new PacketPlayOutArmAnimation()); // sends PacketPlayOutArmAnimation() packet to player
HCore.sendPacket(player, new PacketPlayInAdvancements()); // sends PacketPlayInAdvancements() packet to player
@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.
}