Class RenderItemInFrameEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RenderItemInFrameEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class RenderItemInFrameEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
Fired before an item stack is rendered in an item frame.
This can be used to prevent normal rendering or add custom rendering.
This event is cancellable, and does not have a result. If the event is cancelled, then the item stack will not be rendered
This event is fired on the main Forge event bus, only on the logical client.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.bus.api.Event
net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ItemFrame
private final ItemStack
private final MultiBufferSource
private final int
private final PoseStack
private final ItemFrameRenderer<?>
-
Constructor Summary
ConstructorDescriptionRenderItemInFrameEvent
(ItemFrame itemFrame, ItemFrameRenderer<?> renderItemFrame, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) -
Method Summary
Modifier and TypeMethodDescriptionReturns the item frame entity.Returns the item stack being rendered.Returns the source of rendering buffers.int
Returns the amount of packed (sky and block) light for rendering.Returns the pose stack used for rendering.Returns the renderer for the item frame entity.Methods inherited from class net.neoforged.bus.api.Event
getResult, hasResult, setResult
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
-
itemStack
-
itemFrameEntity
-
renderer
-
poseStack
-
multiBufferSource
-
packedLight
private final int packedLight
-
-
Constructor Details
-
RenderItemInFrameEvent
@Internal public RenderItemInFrameEvent(ItemFrame itemFrame, ItemFrameRenderer<?> renderItemFrame, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight)
-
-
Method Details
-
getItemStack
Returns the item stack being rendered.- Returns:
- the item stack being rendered
-
getItemFrameEntity
Returns the item frame entity.- Returns:
- the item frame entity
-
getRenderer
Returns the renderer for the item frame entity.- Returns:
- the renderer for the item frame entity
-
getPoseStack
Returns the pose stack used for rendering.- Returns:
- the pose stack used for rendering
-
getMultiBufferSource
Returns the source of rendering buffers.- Returns:
- the source of rendering buffers
-
getPackedLight
public int getPackedLight()Returns the amount of packed (sky and block) light for rendering.- Returns:
- the amount of packed (sky and block) light for rendering
- See Also:
-