Class ToastAddEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ToastAddEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class ToastAddEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent
Fired when the client queues a Toast message to be shown onscreen. Toasts are small popups that appear on the top right of the screen, for certain actions such as unlocking Advancements and Recipes.

This event is cancellable, and does not

invalid reference
have a result
. Cancelling the event stops the toast from being queued, which means it never renders.

This event is fired on the main Forge event bus, only on the logical client.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final net.minecraft.client.gui.components.toasts.Toast
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ToastAddEvent(net.minecraft.client.gui.components.toasts.Toast toast)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.gui.components.toasts.Toast
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.bus.api.ICancellableEvent

    isCanceled, setCanceled
  • Field Details

    • toast

      private final net.minecraft.client.gui.components.toasts.Toast toast
  • Constructor Details

    • ToastAddEvent

      public ToastAddEvent(net.minecraft.client.gui.components.toasts.Toast toast)
  • Method Details

    • getToast

      public net.minecraft.client.gui.components.toasts.Toast getToast()