Class ExtractBlockScreenEffectEvent

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

public class ExtractBlockScreenEffectEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent

Fired when a block screen effect overlay is being extracted.

This event is cancellable. If this event is canceled, then the vanilla overlay will not be rendered.

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

  • Field Details

  • Constructor Details

  • Method Details

    • getPlayer

      public LocalPlayer getPlayer()
      Returns the player which the overlay will apply to.
      Returns:
      the player which the overlay will apply to
    • getPlayerRenderState

      public PlayerRenderState getPlayerRenderState()
      Returns the render state of the player which the overlay will apply to.
      Returns:
      the render state of the player which the overlay will apply to
    • getPos

      public BlockPos getPos()
      Returns the position of the block which the overlay is gotten from.
      Returns:
      the position of the block which the overlay is gotten from
    • getState

      public BlockState getState()
      Returns the block which the overlay is gotten from.
      Returns:
      the block which the overlay is gotten from
    • getCamera

      public Camera getCamera()
    • getWorldPartialTick

      public float getWorldPartialTick()
    • getPlayerPartialTick

      public float getPlayerPartialTick()
    • getOverlayType

      Returns the type of the overlay.
      Returns:
      the type of the overlay
    • setCustomRenderer

      public void setCustomRenderer(CustomBlockScreenEffectRenderer renderer)
      Set a custom renderer to prepend or replace the vanilla effect rendering.
      Parameters:
      renderer - The effect renderer to apply
    • setCanceled

      public void setCanceled(boolean canceled)
      Specified by:
      setCanceled in interface net.neoforged.bus.api.ICancellableEvent