Display
All the three display entities are extensions of the Display class.
We will first look into this class and what methods it has.
Display
Teleportation
When moving the location of the display entity you will need to teleport it using teleport(Location):
Display display = new BlockDisplay(spawnLocation);
display.teleport(newLocation);Teleportation Delay
info
This is only supported from version 1.20.2 up
Teleportation delay will add a delay to when the teleportation happens in ticks:
Display display = new BlockDisplay(spawnLocation);
display.setTeleportDelay(20);Meta Data
Entity metadata is all the information of the entity. Some examples are scale and translation. By default, when modifying these it will send the modified metadata, but you are able to send them manually as well:
Display display = new BlockDisplay(spawnLocation);
display.sendMetaDataUpdate();Billboard
Display allow you to modify the way they rotation. This is called Billboard:
| Name | Example |
|---|---|
| FIXED | ![]() |
| VERTICAL | ![]() |
| HORIZONTAL | ![]() |
| CENTER | ![]() |
Here is how you can modify them:
Display display = new TextDisplay(spawnLocation);
display.setBillboard(Display.Billbaord.CENTER)Transformation
Display entities using something called transformation to be able to do some cool movements.
Tip
When using transformation and you want to see how it will look check out this cool site
Scale
When setting the scale requires the new x, y and z scale. You can change the scale by setting all three manually or using a Vector3f:
Display display = new BlockDisplay(spawnLocation);
display.setScale(2f, 5f, 2.5f);val display = BlockDisplay(spawnLocation);
display.setScale(2f, 5f, 2.5f);Rotation
Display entities have their own type of rotation separate from the location. They both have leftRotation and rightRotation. These rotations use quaternionf:
Display display = new BlockDisplay(spawnLocation);
display.setLeftRotation(1.0, 1.0, 1.0, 1.0)
display.setRightRotation(1.0, 1.0, 1.0, 1.0)Translation
The displays translation is like an offset from its true location. You are able to use x, y and z to modify them, but you can also use Vector3f:
Display display = new BlockDisplay(spawnLocation);
display.setTranslation(2.0, 5.0, 2.5);val display = BlockDisplay(spawnLocation);
display.setTranslation(2.0, 5.0, 2.5);Interpolation Duration
Interpolation duration is the time it will take to do the last transformation modification. It will interpolate all the points from the old to new point.
Here we will show a quick example of moving a BlockDisplay one block to the side in 20 ticks:
Display display = new BlockDisplay(spawnLocation);
display.setBlock(Material.STONE);
display.setInterpolationDuration(20);
display.setTranslation(0.0, 0.0, 1.0);
Interpolation Delay
Interpolation delay is the time it will take to start the last transformation modification in ticks.
Display display = new BlockDisplay(spawnLocation);
display.setInterpolationDelat(20);Implementation
TextDisplay
TextDisplay is a type of display entity that can display text. This can be useful to display information to the player.
Text
There is two ways you can set the text of the entity. The default one is by using a String but you can also use an adventure Component:
TextDisplay display = new TextDisplay(spawnLocation);
display.setText("Cool Text");val display = TextDisplay(spawnLocation)
display.setText("Cool Text")Background Color
When setting the background color of a display entity there are two ways of doing it. The first is by using the bukkit Color. The next option is using the ARGB value.
Information
If you want a transparent background you can set the ARBG value to 0
TextDisplay display = new TextDisplay(spawnLocation);
display.setBackgroundColor(Color.RED);val display = TextDisplay(spawnLocation)
display.setBackgroundColor(Color.RED)Block Display
Next we have block displays. These are used to display blocks.
Block
There are two ways of setting the block that is being displayed. First you can use Material enum, second you can use BlockData:
BlockDisplay display = new BlockDisplay(spawnLocation);
display.setBlock(Material.STONE);val display = BlockDisplay(spawnLocation)
display.setBlock(Material.STONE)Item Display
Lastly we have Item Displays. These display ItemStacks
Item
There are two ways for setting the item that needs to be displayed. First by using ItemStack, second you can use Material enum:
ItemDisplay display = new ItemDisplay(spawnLocation);
display.setItem(new ItemStack(Material.STONE));val display = ItemDisplay(spawnLocation)
display.setItem(ItemStack(Material.STONE))


