mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-22 10:25:41 +01:00
Updated Basic tutorial (markdown)
parent
a89e1c044e
commit
cc6f28e46f
@ -55,8 +55,9 @@ public void onEnable() {
|
||||
The API is a class called HolographicDisplaysAPI, all the methods are static. With the method `createHologram(...)` you can create a hologram with some lines. The method returns the hologram just created.
|
||||
Example:
|
||||
```java
|
||||
// Suppose that "player" is a Player object obtained before (e.g. in a command), and "plugin" is your plugin's instance.
|
||||
Hologram hologram = HolographicDisplaysAPI.createHologram(plugin, player.getEyeLocation(), "Test hologram");
|
||||
// Suppose that "where" is a Location object obtained before (e.g. in a command), and "plugin" is your plugin's instance.
|
||||
Location where = ...
|
||||
Hologram hologram = HolographicDisplaysAPI.createHologram(plugin, where, "Test hologram");
|
||||
```
|
||||
|
||||
Done! With just one line of code you created a hologram.
|
||||
@ -67,6 +68,9 @@ If you want to add more lines when creating the hologram, add them at the end of
|
||||
```java
|
||||
HolographicDisplaysAPI.createHologram(plugin, player.getEyeLocation(), "Test hologram", "Line 2", "Line 3", "Line 4");
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Static API methods
|
||||
|
||||
`Hologram HolographicDisplaysAPI.createHologram(Plugin owner, Location location, String... lines)`
|
||||
|
Loading…
Reference in New Issue
Block a user