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 Summary

    Modifier and Type
    Method
    Description
    void
    billboard(org.bukkit.entity.Display.Billboard billboard)
    Sets the billboard constraint for the display.
    void
    brightness(int block, int sky)
    Sets the brightness override for the display.
    Creates a transformer for animating this display.
    void
    display(org.bukkit.entity.ItemDisplay.ItemDisplayTransform transform)
    Sets the item display transform type.
    void
    glow(boolean glow)
    Toggles the glowing effect.
    void
    glowColor(int glowColor)
    Sets the glow color.
    boolean
    Checks if this display is currently invisible.
    void
    invisible(boolean invisible)
    Sets the visibility of this display.
    void
    item(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Sets the item stack to be displayed.
    void
    moveDuration(int duration)
    Sets the duration for position/rotation interpolation.
    void
    remove(@NotNull PacketBundler bundler)
    Removes this display.
    void
    rotate(@NotNull ModelRotation rotation, @NotNull PacketBundler bundler)
    Rotates this display to a specific orientation.
    void
    Sends updated entity data if it has changed.
    void
    sendEntityData(boolean showItem, @NotNull PacketBundler bundler)
    Sends entity data, optionally showing the item.
    void
    sendPosition(@NotNull BaseEntity adapter, @NotNull PacketBundler bundler)
    Sends the position of the display relative to an entity adapter.
    void
    shadowRadius(float radius)
    Sets the shadow radius of the display.
    void
    spawn(boolean showItem, @NotNull PacketBundler bundler)
    Spawns this display, optionally showing the item.
    default void
    spawn(@NotNull PacketBundler bundler)
    Spawns this display using the provided packet bundler.
    default void
    Spawns this display and sends initial entity data.
    void
    syncEntity(@NotNull BaseEntity entity)
    Synchronizes this display with a source entity's data.
    void
    syncPosition(@NotNull org.bukkit.Location location)
    Synchronizes this display's position with a location.
    void
    teleport(@NotNull org.bukkit.Location location, @NotNull PacketBundler bundler)
    Teleports this display to a new location.
    void
    viewRange(float range)
    Sets the view range of the display.

    Methods inherited from interface kr.toxicity.model.api.nms.Identifiable

    id, uuid
  • 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
    • syncEntity

      void syncEntity(@NotNull @NotNull BaseEntity entity)
      Synchronizes this display with a source entity's data.
      Parameters:
      entity - the source entity
      Since:
      1.15.2
    • syncPosition

      void syncPosition(@NotNull @NotNull org.bukkit.Location 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 org.bukkit.entity.ItemDisplay.ItemDisplayTransform 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 org.bukkit.Location 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 org.bukkit.inventory.ItemStack 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 org.bukkit.entity.Display.Billboard billboard)
      Sets the billboard constraint for the display.
      Parameters:
      billboard - the billboard type
      Since:
      1.15.2