-
Notifications
You must be signed in to change notification settings - Fork 33
Snackbar
The Snackbar is a small notification on the bottom of the Minecraft window. The Snackbar is used to give the player feedback or information about something. It does not handle any input and clicks will go through it.
To create a new snackbar instance, all you have to do is call
Snackbar.create()The one and only argument is the message. This is the text that will be shown when the snackbar itself is shown.
You can also set a custom show duration for the snackbar. this is possible by the following method:
snackbar.setDuration()This method also returns the snackbar instance itself, so you can one-line it with the snackbar instance creation. If no duration is set, the text length * 3 is used.
You can show snackbar instances multiple times. You can achieve this by calling:
SnackbarHandler.INSTANCE.showSnackbar()the method only has one argument, the snackbar instance. If there's already a snackbar shown, this snackbar will be added to the queue and displayed once the current snackbar closes. If the server calls this method, all clients will see the snackbar.
