Asynchronous, high-performance Minecraft Hologram library for 1.8-1.19 servers.
This library can only be used on spigot servers higher or on version 1.8.8. The plugin ProtocolLib is required on your server.
Add the repository and dependency to your plugin: Maven
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.unldenis</groupId>
<artifactId>Hologram-Lib</artifactId>
<version>2.0.0</version>
</dependency>
Gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.unldenis:Hologram-Lib:master-SNAPSHOT'
}
Add ProtocolLib as dependency to your plugin.yml. It could look like this:
name: Hub
version: 1.0-SNAPSHOT
api-version: "1.13"
depend: [ProtocolLib]
author: unldenis
Animation | Hologram Integration | Clickable | |
---|---|---|---|
Line | |||
TextLine | ✅ | ✅(w/ Pool) | |
TextALine | ✅ | ✅ | |
ClickableTextLine | ✅ | ✅ | |
ItemLine | ✅ | ||
ItemALine | ✅ | ✅ |
These are the lines provided by the library, thanks to the composition of various parts. The library is structured so that you too can create your own custom hologram.
To be integrated into a Hologram composed of multiple lines you need to implement ILine.
The libraries that integrate Hologram-Lib
public Hologram firstExample(Location loc) {
// create new line structure (armorstand)
Line line = new Line(plugin);
// compose an TextLine hologram
TextLine textLine = new TextLine(line, "Hello", placeholders, true);
// create new line structure (armorstand)
Line line2 = new Line(plugin);
// compose this second TextLine hologram
TextLine textLine2 = new TextLine(line2, "%%player%%", placeholders, true);
// append to hologram that will make all the hard work for you
// the TextSequentialLoader loader will load lines(text only) one after the other. It is an experimental function.
Hologram hologram = new Hologram(plugin, loc, new TextSequentialLoader());
// remember to call this method or hologram will not be visible
hologram.load(textLine, textLine2);
// add hologram to pool
pool.takeCareOf(hologram);
return hologram;
}
Click here if you want to see the full guided example.