Interface ModelDisplay

All Superinterfaces:
Identifiable

public interface ModelDisplay extends Identifiable
Represents an item display entity used for rendering model parts.

This interface abstracts the NMS implementation of item displays, allowing for manipulation of position, rotation, scale, and other display properties.

Since:
1.15.2
  • Method Details

    • invisible

      boolean invisible()
      Checks if this display is currently invisible.
      Returns:
      true if invisible, false otherwise
      Since:
      1.15.2
    • invisible

      void invisible(boolean invisible)
      Sets the visibility of this display.
      Parameters:
      invisible - true to make invisible, false to make visible
      Since:
      1.15.2
    • rotate

      void rotate(@NotNull @NotNull ModelRotation rotation, @NotNull @NotNull PacketBundler bundler)
      Rotates this display to a specific orientation.
      Parameters:
      rotation - the target rotation
      bundler - the packet bundler to use
      Since:
      1.15.2
    • syncPotionEffect

      void syncPotionEffect(@NotNull @NotNull BaseEntity entity)
      Synchronizes the potion effect (glowing, etc.) from the base entity to this display.
      Parameters:
      entity - the source entity
      Since:
      2.2.0
    • syncPosition

      void syncPosition(@NotNull @NotNull PlatformLocation location)
      Synchronizes this display's position with a location.
      Parameters:
      location - the target location
      Since:
      1.15.2
    • moveDuration

      void moveDuration(int duration)
      Sets the duration for position/rotation interpolation.
      Parameters:
      duration - the duration in ticks
      Since:
      1.15.2
    • display

      void display(@NotNull @NotNull PlatformItemTransform transform)
      Sets the item display transform type.
      Parameters:
      transform - the transform type
      Since:
      1.15.2
    • spawn

      default void spawn(@NotNull @NotNull PacketBundler bundler)
      Spawns this display using the provided packet bundler.
      Parameters:
      bundler - the packet bundler
      Since:
      1.15.2
    • spawnWithEntityData

      default void spawnWithEntityData(@NotNull @NotNull PacketBundler bundler)
      Spawns this display and sends initial entity data.
      Parameters:
      bundler - the packet bundler
      Since:
      1.15.2
    • spawn

      void spawn(boolean showItem, @NotNull @NotNull PacketBundler bundler)
      Spawns this display, optionally showing the item.
      Parameters:
      showItem - true to show the item, false otherwise
      bundler - the packet bundler
      Since:
      1.15.2
    • remove

      void remove(@NotNull @NotNull PacketBundler bundler)
      Removes this display.
      Parameters:
      bundler - the packet bundler
      Since:
      1.15.2
    • teleport

      void teleport(@NotNull @NotNull PlatformLocation location, @NotNull @NotNull PacketBundler bundler)
      Teleports this display to a new location.
      Parameters:
      location - the target location
      bundler - the packet bundler
      Since:
      1.15.2
    • item

      void item(@NotNull @NotNull PlatformItemStack itemStack)
      Sets the item stack to be displayed.
      Parameters:
      itemStack - the item stack
      Since:
      1.15.2
    • createTransformer

      @NotNull @NotNull DisplayTransformer createTransformer()
      Creates a transformer for animating this display.
      Returns:
      the display transformer
      Since:
      1.15.2
    • sendDirtyEntityData

      void sendDirtyEntityData(@NotNull @NotNull PacketBundler bundler)
      Sends updated entity data if it has changed.
      Parameters:
      bundler - the packet bundler
      Since:
      1.15.2
    • sendEntityData

      void sendEntityData(boolean showItem, @NotNull @NotNull PacketBundler bundler)
      Sends entity data, optionally showing the item.
      Parameters:
      showItem - true to show the item, false otherwise
      bundler - the packet bundler
      Since:
      1.15.2
    • brightness

      void brightness(int block, int sky)
      Sets the brightness override for the display.
      Parameters:
      block - the block light level
      sky - the skylight level
      Since:
      1.15.2
    • viewRange

      void viewRange(float range)
      Sets the view range of the display.
      Parameters:
      range - the view range
      Since:
      1.15.2
    • shadowRadius

      void shadowRadius(float radius)
      Sets the shadow radius of the display.
      Parameters:
      radius - the shadow radius
      Since:
      1.15.2
    • sendPosition

      void sendPosition(@NotNull @NotNull BaseEntity adapter, @NotNull @NotNull PacketBundler bundler)
      Sends the position of the display relative to an entity adapter.
      Parameters:
      adapter - the entity adapter
      bundler - the packet bundler
      Since:
      1.15.2
    • glow

      void glow(boolean glow)
      Toggles the glowing effect.
      Parameters:
      glow - true to enable glow, false to disable
      Since:
      1.15.2
    • glowColor

      void glowColor(int glowColor)
      Sets the glow color.
      Parameters:
      glowColor - the RGB glow color
      Since:
      1.15.2
    • billboard

      void billboard(@NotNull @NotNull PlatformBillboard billboard)
      Sets the billboard constraint for the display.
      Parameters:
      billboard - the billboard type
      Since:
      1.15.2