Interface ModelDisplay
- All Superinterfaces:
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 TypeMethodDescriptionvoidbillboard(@NotNull PlatformBillboard billboard) Sets the billboard constraint for the display.voidbrightness(int block, int sky) Sets the brightness override for the display.@NotNull DisplayTransformerCreates a transformer for animating this display.voiddisplay(@NotNull PlatformItemTransform transform) Sets the item display transform type.voidglow(boolean glow) Toggles the glowing effect.voidglowColor(int glowColor) Sets the glow color.booleanChecks if this display is currently invisible.voidinvisible(boolean invisible) Sets the visibility of this display.voiditem(@NotNull PlatformItemStack itemStack) Sets the item stack to be displayed.voidmoveDuration(int duration) Sets the duration for position/rotation interpolation.voidremove(@NotNull PacketBundler bundler) Removes this display.voidrotate(@NotNull ModelRotation rotation, @NotNull PacketBundler bundler) Rotates this display to a specific orientation.voidsendDirtyEntityData(@NotNull PacketBundler bundler) Sends updated entity data if it has changed.voidsendEntityData(boolean showItem, @NotNull PacketBundler bundler) Sends entity data, optionally showing the item.voidsendPosition(@NotNull BaseEntity adapter, @NotNull PacketBundler bundler) Sends the position of the display relative to an entity adapter.voidshadowRadius(float radius) Sets the shadow radius of the display.voidspawn(boolean showItem, @NotNull PacketBundler bundler) Spawns this display, optionally showing the item.default voidspawn(@NotNull PacketBundler bundler) Spawns this display using the provided packet bundler.default voidspawnWithEntityData(@NotNull PacketBundler bundler) Spawns this display and sends initial entity data.voidsyncPosition(@NotNull PlatformLocation location) Synchronizes this display's position with a location.voidsyncPotionEffect(@NotNull BaseEntity entity) Synchronizes the potion effect (glowing, etc.) from the base entity to this display.voidteleport(@NotNull PlatformLocation location, @NotNull PacketBundler bundler) Teleports this display to a new location.voidviewRange(float range) Sets the view range of the display.Methods inherited from interface 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
Rotates this display to a specific orientation.- Parameters:
rotation- the target rotationbundler- the packet bundler to use- Since:
- 1.15.2
-
syncPotionEffect
Synchronizes the potion effect (glowing, etc.) from the base entity to this display.- Parameters:
entity- the source entity- Since:
- 2.2.0
-
syncPosition
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
Sets the item display transform type.- Parameters:
transform- the transform type- Since:
- 1.15.2
-
spawn
Spawns this display using the provided packet bundler.- Parameters:
bundler- the packet bundler- Since:
- 1.15.2
-
spawnWithEntityData
Spawns this display and sends initial entity data.- Parameters:
bundler- the packet bundler- Since:
- 1.15.2
-
spawn
Spawns this display, optionally showing the item.- Parameters:
showItem- true to show the item, false otherwisebundler- the packet bundler- Since:
- 1.15.2
-
remove
Removes this display.- Parameters:
bundler- the packet bundler- Since:
- 1.15.2
-
teleport
Teleports this display to a new location.- Parameters:
location- the target locationbundler- the packet bundler- Since:
- 1.15.2
-
item
Sets the item stack to be displayed.- Parameters:
itemStack- the item stack- Since:
- 1.15.2
-
createTransformer
Creates a transformer for animating this display.- Returns:
- the display transformer
- Since:
- 1.15.2
-
sendDirtyEntityData
Sends updated entity data if it has changed.- Parameters:
bundler- the packet bundler- Since:
- 1.15.2
-
sendEntityData
Sends entity data, optionally showing the item.- Parameters:
showItem- true to show the item, false otherwisebundler- 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 levelsky- 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
Sends the position of the display relative to an entity adapter.- Parameters:
adapter- the entity adapterbundler- 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
Sets the billboard constraint for the display.- Parameters:
billboard- the billboard type- Since:
- 1.15.2
-