AbyssalLib Help

Toasts

The Toast API leverages Minecraft's advancement packet system to display transient pop-up messages in the top-right corner of the player's screen.

Creating and Sending a Toast

To create a toast notification, use Toast.builder(). You can configure the title, subtitle, icon, and the border frame style. Once built, simply call send(Player).

public final class NotificationUtil { public static void sendLevelUpToast(Player player, int level) { Toast toast = Toast.builder() // The primary title .line1(TextUtil.parse("<green>Level Up!</green>")) // The secondary description beneath the title .line2(TextUtil.parse("<gray>You reached level " + level + ".</gray>")) // The visual item icon .icon(new ItemStack(Material.EXPERIENCE_BOTTLE)) // The border style (TASK, GOAL, or CHALLENGE) .frame(AdvancementFrame.CHALLENGE) .build(); // Send the packets to the player toast.send(player); } }

[IMG?]

Builder Configuration Methods

The Toast.Builder provides a simple fluent interface for configuring the notification's appearance.

Method

Description

line1(Component)

(Required) Sets the primary header text displayed in the toast.

line2(Component)

(Optional) Sets the sub-header text displayed underneath the main title. If omitted, the toast will only display one line.

icon(ItemStack)

(Required) Sets the item stack used as the visual icon on the left side of the notification.

frame(AdvancementFrame)

Sets the border frame style used for the notification. This dictates the background color and border shape (e.g., TASK, GOAL, CHALLENGE). Defaults to TASK.

build()

Finalizes the configuration and produces the Toast instance, ready to be sent.

05 June 2026