Interface Notification


public sealed interface Notification
Is used to send temporary advancements to the client, which are called notifications.
Here is an example of its use:

 Notification notification = Notification.builder()
  .frameType(FrameType.TASK)
  .title(Component.text("Welcome!"))
  .icon(Material.IRON_SWORD).build();
 notification.send(player);
 
The constant IDENTIFIER is used for the advancement packet The constant REMOVE_PACKET is used to remove previous notifications
Since:
1.4.1
  • Field Details

  • Method Details

    • builder

      @Contract(pure=true) @NotNull static @NotNull Notification.Builder builder()
      Creates a new builder instance
      Returns:
      an instance of the builder
    • send

      void send(@NotNull @NotNull Player player)
      Send the notification to the client
      Parameters:
      player - to get be sent
    • send

      void send(@NotNull @NotNull Collection<@NotNull Player> players)
      Send the notification to a collection of clients
      Parameters:
      players - to get be sent
    • title

      @NotNull @NotNull Component title()
      Gets the title of the notification as a Component
      Returns:
      the title Component
    • type

      @NotNull @NotNull FrameType type()
      Get the FrameType of the notification
      Returns:
      the type
    • icon

      @NotNull @NotNull ItemStack icon()
      Get the displayed icon of the notification as ItemStack
      Returns:
      the ItemStack