Skip to content

Commit

Permalink
Print death message in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Jul 11, 2024
1 parent abdb795 commit 1b8d5ea
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ public void register() {
if (action != 2) {
return;
}
wrapper.passthrough(Types.VAR_INT); // Duration

final EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class);
final int entityId = wrapper.passthrough(Types.INT);
final int entityId = wrapper.passthrough(Types.VAR_INT);
wrapper.passthrough(Types.INT); // Killer id

if (entityId != tracker.clientEntityId()) {
return;
Expand All @@ -198,7 +198,7 @@ public void register() {

final PacketWrapper chatMessage = wrapper.create(ClientboundPackets1_8.CHAT);
chatMessage.write(Types.COMPONENT, message);
chatMessage.write(Types.BYTE, (byte) 2); // Position - above hotbar
chatMessage.write(Types.BYTE, (byte) 1); // Position - in chat
chatMessage.scheduleSend(Protocol1_9To1_8.class);
});

Expand Down

0 comments on commit 1b8d5ea

Please sign in to comment.