Class ButtonClickPacket

All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload

public class ButtonClickPacket extends PacketCodec
Packet for notifying the server of a button click.
  • Field Details

    • ID

      public static final net.minecraft.resources.ResourceLocation ID
  • Constructor Details

    • ButtonClickPacket

      public ButtonClickPacket()
    • ButtonClickPacket

      public ButtonClickPacket(String buttonId)
  • Method Details

    • isAsync

      public boolean isAsync()
      Specified by:
      isAsync in class PacketBase
      Returns:
      If this packet can run on a thread other than the main-thread of Minecraft. If this is asynchronous, the player parameter inside the action is not guaranteed to be defined.
    • actionClient

      public void actionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player)
      Description copied from class: PacketBase
      Actions for client-side.
      Specified by:
      actionClient in class PacketBase
      Parameters:
      level - The world.
      player - The player. Can be null if this packet is asynchronous.
    • actionServer

      public void actionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player)
      Description copied from class: PacketBase
      Actions for server-side.
      Specified by:
      actionServer in class PacketBase
      Parameters:
      level - The world.
      player - The player.