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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of the block overlay to be rendered. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cameraprivate final ExtractBlockScreenEffectEvent.OverlayTypeprivate final LocalPlayerprivate final floatprivate final PlayerRenderStateprivate final BlockPosprivate final BlockStateprivate final float -
Constructor Summary
ConstructorsConstructorDescriptionExtractBlockScreenEffectEvent(LocalPlayer player, PlayerRenderState playerRenderState, BlockPos pos, BlockState state, Camera camera, float worldPartialTick, float playerPartialTick, ExtractBlockScreenEffectEvent.OverlayType type) -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of the overlay.Returns the player which the overlay will apply to.floatReturns the render state of the player which the overlay will apply to.getPos()Returns the position of the block which the overlay is gotten from.getState()Returns the block which the overlay is gotten from.floatvoidsetCanceled(boolean canceled) voidSet a custom renderer to prepend or replace the vanilla effect rendering.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled
-
Field Details
-
player
-
playerRenderState
-
pos
-
state
-
camera
-
worldPartialTick
private final float worldPartialTick -
playerPartialTick
private final float playerPartialTick -
overlayType
-
-
Constructor Details
-
ExtractBlockScreenEffectEvent
@Internal public ExtractBlockScreenEffectEvent(LocalPlayer player, PlayerRenderState playerRenderState, BlockPos pos, BlockState state, Camera camera, float worldPartialTick, float playerPartialTick, ExtractBlockScreenEffectEvent.OverlayType type)
-
-
Method Details
-
getPlayer
Returns the player which the overlay will apply to.- Returns:
- the player which the overlay will apply to
-
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
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
Returns the block which the overlay is gotten from.- Returns:
- the block which the overlay is gotten from
-
getCamera
-
getWorldPartialTick
public float getWorldPartialTick() -
getPlayerPartialTick
public float getPlayerPartialTick() -
getOverlayType
Returns the type of the overlay.- Returns:
- the type of the overlay
-
setCustomRenderer
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:
setCanceledin interfacenet.neoforged.bus.api.ICancellableEvent
-