Class AddKeybindPacket

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

public class AddKeybindPacket extends Object
Network packet sent from client to server to request adding a new keybind. This packet allows clients to register new dynamic keybinds on the server side, which are then persisted and synchronized to all players. It carries the keybind ID, key code, and category information.

Direction: Client -> Server

Handler: Server-side keybind handler (ForgeServerKeybindHandler or FabricServerKeybindHandler)

  • Constructor Details

    • AddKeybindPacket

      public AddKeybindPacket(String id, int keyCode, String category)
      Construct a new AddKeybindPacket.
      Parameters:
      id - unique keybind identifier
      keyCode - the GLFW key code
      category - the keybind category
    • AddKeybindPacket

      public AddKeybindPacket(String id, int keyCode, String category, Optional<DynamicKeybindAction> action)
      Construct a new AddKeybindPacket with an optional action.
      Parameters:
      id - unique keybind identifier
      keyCode - the GLFW key code
      category - the keybind category
      action - optional action payload
  • Method Details

    • getId

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

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

      public String getCategory()
      Get the keybind category.
      Returns:
      the category string
    • getAction

      public Optional<DynamicKeybindAction> getAction()
      Get the optional action payload.
      Returns:
      optional action