Skip to content

A Fabric library which makes creating and displaying 'toasts' in Minecraft easier

License

Notifications You must be signed in to change notification settings

caoimhebyrne/Toasts

Repository files navigation

image

Toasts

Toasts is a Fabric library which makes creating and displaying 'toasts' in Minecraft easier.

The main branch is the latest stable version of Toasts, for current development, see the dev branch.

Adding to your mod

TODO

Usage

Creating and showing a toast

new BasicToastBuilder()
        .title("My toast")
        .description("Hello World") // Only required option
        .build()
        .show();

Adding an icon to a toast

new BasicToastBuilder()
        .title("My toast")
        .description("Hello World") // Only required option
        .icon(new Identifier("textures/item/diamond_sword.png"))
        .build()
        .show();

Dismissing the toast after a certain amount of time

// This toast will dismiss after 2000 ms
new BasicToastBuilder()
        .title("My toast")
        .description("Hello World") // Only required option
        .displayTime(2000)
        .build()
        .show();

Executing code when the toast dismisses

new BasicToastBuilder()
        .title("My toast")
        .description("Hello World") // Only required option
        .decayHandler(()->System.out.println("Toast completed!"))
        .build()
        .show();

About

A Fabric library which makes creating and displaying 'toasts' in Minecraft easier

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published