Emotes
The EmotePacket
is a client-bound packet that allows servers to let NPCs perform emotes.
Important Note
To prevent abuse, this does not work for real players. You can only perform emotes on players that have the second half of their UUID entirely being 0 (-> 64 least significant bits are 0, or the second long value equals 0).
You therefore need to spawn them with a uuid like this.
Creating the Emote Model
The packet uses the Emote
model.
Play an Emote
Create the model with Emote.play(UUID, int)
to create an emote with the unique id of the npc and the id of the emote to perform.
Emote emote = Emote.play(npcUniqueId, 2);
Stop an Emote
Create the model with Emote.stop(UUID)
to stop the current emote of the npc.
Emote emote = Emote.stop(npcUniqueId);
Sending the Packet
// Create a List of emotes (array is also possible)
List<Emote> emotes = new ArrayList<>();
// Add all emotes you want to perform
emotes.add(emote);
// Get the LabyModProtocol
LabyModProtocol labyModProtocol = LabyModProtocolService.get().labyModProtocol();
// Send the packet
labyModProtocol.sendPacket(uniqueId, new EmotePacket(emotes));
Available Emotes
The following emotes are available: