Class ConsumeItemAction


public class ConsumeItemAction extends ItemStackAction
  • Constructor Details

    • ConsumeItemAction

      public ConsumeItemAction(int reqId, int count, @NonNull com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData sourceData)
  • Method Details

    • isValid

      public boolean isValid(CloudPlayer player)
      Description copied from class: InventoryAction
      Returns whether this action is currently valid. This should perform any necessary sanity checks.
      Specified by:
      isValid in class InventoryAction
      Parameters:
      player - player
      Returns:
      valid
    • execute

      public boolean execute(CloudPlayer player)
      Description copied from class: InventoryAction
      Performs actions needed to complete the inventory-action server-side. Returns if it was successful. Will return false if plugins cancelled events. This will only be called if the transaction which it is part of is considered valid.
      Specified by:
      execute in class InventoryAction
      Parameters:
      player - player
      Returns:
      successfully executed
    • getContainers

      protected List<com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.ContainerEntry> getContainers(CloudPlayer player)
      Specified by:
      getContainers in class ItemStackAction