Class UpdateKeybindPacket

java.lang.Object
dev.munebase.dynamickeybinds.network.UpdateKeybindPacket

public class UpdateKeybindPacket extends Object
Network packet sent from client to server to request updating a keybind's key code. Allows clients to rebind an existing keybind to a different key without removing it. This is used when players customize their keybind settings. The update is persisted on the server and synchronized to all clients.

Direction: Client -> Server

Handler: ForgeServerKeybindHandler or FabricServerKeybindHandler

  • Constructor Details

    • UpdateKeybindPacket

      public UpdateKeybindPacket(String id, int keyCode)
      Construct a new UpdateKeybindPacket.
      Parameters:
      id - the keybind ID to update
      keyCode - the new GLFW key code
  • Method Details

    • getId

      public String getId()
      Get the keybind ID to update.
      Returns:
      the keybind identifier
    • getKeyCode

      public int getKeyCode()
      Get the new key code.
      Returns:
      the new GLFW key code