@@ -168,8 +168,10 @@ world.spawn(location, BlockDisplay.class, entity -> {
168168
169169## Interpolation
170170
171- A transformation can be linearly interpolated by the client to create a smooth animation,
172- switching from one transformation to the next.
171+ Transformations and teleports can be linearly interpolated by the client to create a smooth animation,
172+ switching from one transformation/location to the next.
173+
174+ ### Transformation
173175
174176An example of this would be smoothly rotating a block/item/text in-place. In conjunction with the
175177[ Scheduler API] ( /paper/dev/scheduler ) , the animation can be restarted after it's done,
@@ -197,6 +199,22 @@ Bukkit.getScheduler().runTaskTimer(plugin, task -> {
197199
198200<span class =" img-inline-center " >![ Interpolation example] ( ./assets/display-interp.gif ) </span >
199201
202+ ### Teleportation
203+
204+ Similarly to the transformation interpolation, you may also want to interpolate the movement
205+ of the entire display entity between two points.
206+
207+ A similar effect may be achieved using an interpolated translation, however if you change
208+ other properties of the transformation, those too will be interpolated, which may or may not be what you want.
209+
210+ ``` java
211+ // new position will be 10 blocks higher
212+ Location newLocation = display. getLocation(). add(0 , 10 , 0 );
213+
214+ display. setTeleportDuration(20 * 10 ); // the movement will take 10 seconds (1 second = 20 ticks)
215+ display. teleport(newLocation); // perform the movement
216+ ```
217+
200218## Use cases
201219
202220Displays have many different use cases, ranging from stationary decoration to complex animation.
0 commit comments