Class TEntityElement

All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>

@Environment(CLIENT) @Virtual public class TEntityElement extends TElement
TElement that renders an entity on the screen.
  • Constructor Details

    • TEntityElement

      public TEntityElement(@NotNull @NotNull net.minecraft.world.entity.EntityType<?> entityType)
    • TEntityElement

      public TEntityElement()
  • Method Details

    • entityTypeProperty

      public final NotNullProperty<net.minecraft.world.entity.EntityType<?>> entityTypeProperty()
      Returns the NotNullProperty holding the EntityType that is to be rendered by this TEntityElement.
    • followsCursorProperty

      public final BooleanProperty followsCursorProperty()
      Returns the BooleanProperty that determines whether this the rendered Entity's on-screen rotation follows the cursor location.
    • entityScaleProperty

      public final DoubleProperty entityScaleProperty()
      Returns the DoubleProperty that determines the scale at which the rendered Entity is drawn.
    • getDisplayError

      @Nullable public final @Nullable Throwable getDisplayError()
      Returns the Throwable that was thrown during the last attempt to create and/or render the display Entity, if any.

      This is usually used for debugging purposes, as some modded entities do not support being rendered on-screen, and will throw when attempts are made to create and/or render them. In such cases, this method can be used to retrieve the exception that was thrown.

    • getDisplayEntity

      @Nullable public final @Nullable net.minecraft.world.entity.Entity getDisplayEntity()
      Cached Entity instance used by this TEntityElement for rendering said Entity on the GUI screen.

      This value is assigned automatically. You should avoid trying to set this value, instead only read it in case you are overriding renderCallback(TGuiGraphics).

      In addition, this value is null whenever something goes wrong when attempting to create and/or render the Entity instance. This is usually due to Exceptions being raised during attempts to render the display Entity.

      See Also:
    • renderCallback

      @Virtual public void renderCallback(@NotNull @NotNull TGuiGraphics pencil)
      Description copied from interface: INodeRenderable
      Callback method that is invoked when this Node is being rendered.
      Specified by:
      renderCallback in interface INodeRenderable<TElement, TGuiGraphics>
      Overrides:
      renderCallback in class TElement
      Parameters:
      pencil - The rendering context.