mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-22 10:25:41 +01:00
Updated Moving holograms (markdown)
parent
5e26b87951
commit
0c2367f5ab
@ -1,11 +1,11 @@
|
||||
Moving holograms it's really simple. Just use the `teleport(Location loc)` method, as fast as you want. Previously using the `setLocation(Location loc)` and `update()` methods was creating new entities every time, generating possible lag if used frequently.
|
||||
Moving holograms it's really simple. Just use the `teleport(Location loc)` method.
|
||||
|
||||
|
||||
|
||||
**Example**: a hologram that follows a player above his head for 5 seconds.
|
||||
```java
|
||||
// Suppose that we have already a Player object called "player"
|
||||
final Hologram hologram = HolographicDisplaysAPI.createHologram(plugin, player.getLocation().add(0.0, 2.0, 0.0), "Chat > Message");
|
||||
final Hologram hologram = HolographicDisplaysAPI.createHologram(plugin, player.getLocation().add(0.0, 2.0, 0.0));
|
||||
hologram.appendTextLine("Chat > Message");
|
||||
|
||||
new BukkitRunnable() {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user