Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caoimhebyrne/toasts
A Fabric library which makes creating and displaying 'toasts' in Minecraft easier
https://github.com/caoimhebyrne/toasts
fabric fabric-library minecraft
Last synced: 2 months ago
JSON representation
A Fabric library which makes creating and displaying 'toasts' in Minecraft easier
- Host: GitHub
- URL: https://github.com/caoimhebyrne/toasts
- Owner: caoimhebyrne
- License: mit
- Created: 2021-12-20T21:53:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-21T11:11:12.000Z (over 2 years ago)
- Last Synced: 2024-05-01T18:13:17.117Z (8 months ago)
- Topics: fabric, fabric-library, minecraft
- Language: Java
- Homepage:
- Size: 76.2 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![image](.github/images/image.png)
## Toasts
Toasts is a Fabric library which makes creating and displaying 'toasts' in Minecraft easier.
*The [main branch](https://github.com/cbyrneee/Toasts) is the latest stable version of Toasts, for current development, see the [dev branch](https://github.com/cbyrneee/Toasts/tree/dev).*
### Adding to your mod
**TODO**
### Usage
**Creating and showing a toast**
```java
new BasicToastBuilder()
.title("My toast")
.description("Hello World") // Only required option
.build()
.show();
```**Adding an icon to a toast**
```java
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**
```java
// 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**
```java
new BasicToastBuilder()
.title("My toast")
.description("Hello World") // Only required option
.decayHandler(()->System.out.println("Toast completed!"))
.build()
.show();
```