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:
  • Field Details

    • itemStack

      private final ItemStack itemStack
    • itemFrameEntity

      private final ItemFrame itemFrameEntity
    • renderer

      private final ItemFrameRenderer<?> renderer
    • poseStack

      private final PoseStack poseStack
    • multiBufferSource

      private final MultiBufferSource multiBufferSource
    • packedLight

      private final int packedLight
  • Constructor Details

  • Method Details

    • getItemStack

      public ItemStack getItemStack()
      Returns the item stack being rendered.
      Returns:
      the item stack being rendered
    • getItemFrameEntity

      public ItemFrame getItemFrameEntity()
      Returns the item frame entity.
      Returns:
      the item frame entity
    • getRenderer

      public ItemFrameRenderer<?> getRenderer()
      Returns the renderer for the item frame entity.
      Returns:
      the renderer for the item frame entity
    • getPoseStack

      public PoseStack getPoseStack()
      Returns the pose stack used for rendering.
      Returns:
      the pose stack used for rendering
    • getMultiBufferSource

      public MultiBufferSource 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: