docs: add documentation for FancyHolograms

This commit is contained in:
Oliver
2025-03-30 16:23:17 +02:00
parent 496eb454ac
commit bc227ede2e
29 changed files with 592 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
---
redirect: getting-started.md
icon: code
order: 6
---
# API usage

View File

@@ -0,0 +1,130 @@
# Getting started
## Include the API in your project
To include the FancyHolograms API in your project, you need to add the following dependency to your `build.gradle.kts` or `pom.xml` file.
**Gradle:**
```kotlin
repositories {
maven("https://repo.fancyplugins.de/releases")
}
```
```kotlin
dependencies {
compileOnly("de.oliver:FancyHolograms:VERSION")
}
```
**Maven:**
```xml
<repository>
<id>fancyplugins-releases</id>
<name>FancyPlugins Repository</name>
<url>https://repo.fancyplugins.de/releases</url>
</repository>
```
```xml
<dependency>
<groupId>de.oliver</groupId>
<artifactId>FancyHolograms</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
```
Replace `VERSION` with the version of the API you want to use. You can find the latest version on the download pages or in the GitHub releases.
## Create a new hologram
### 1. Create the hologram data
The TextHologramData class is used to store all the information about aa hologram. You can create a new instance of TextHologramData by providing a name, and the location where the hologram should be spawned.
```java
TextHologramData hologramData = new TextHologramData("hologram_name", location);
// Adjust the Hologram Data
hologramData.setBackground(TextColor.color(100, 255, 79));
hologramData.setBillboard(Display.Billboard.FIXED);
```
!!!
You can also use ItemHologramData or ItemHologramData to create a holograms with other types.
!!!
### 2. Create the hologram
You can use the TextHologramData object to create a new hologram. Because the implementation of the hologram different for every Minecraft version, FancyHolograms provides a factory to create the hologram.
```java
HologramManager manager = FancyHologramsPlugin.get().getHologramManager();
Hologram hologram = manager.create(data);
```
### 3. Register the hologram
To let FancyHolograms handle the hologram, you need to register it. FancyHolograms will take care of spawning, despawning, saving the hologram, and more.
```java
HologramManager manager = FancyHologramsPlugin.get().getHologramManager();
manager.addHologram(hologram);
```
!!!
If you don't want to persist the npc, you can do the following: `npc.setPersistent(false);`
!!!
## Modify an existing hologram
### 1. Get the hologram by name
You can get the hologram by its name. The name is unique and can be used to identify the hologram.
```java
HologramManager manager = FancyHologramsPlugin.get().getHologramManager();
Hologram hologram = manager.getHologram("hologram_name").orElse(null);
if (hologram == null) {
// hologram not found
return;
}
```
### 2. Modify the data
You can modify the hologram data object to change the holograms's properties.
```java
HologramData hologramData = hologram.getData();
hologramData.setBillboard(Display.Billboard.CENTER);
if (hologramData instanceof TextHologramData textData) {
textData.setTextAlignment(TextDisplay.TextAlignment.LEFT);
}
```
### 3. Update the hologram
After modifying the hologram data, you need to update the hologram. This will apply the changes to the hologram.
```java
hologram.forceUpdate();
hologram.queueUpdate();
```
## Remove a hologram
To remove a hologram, you can use the `removeHologram` method of the `HologramManager`. This will remove the hologram and unregister it.
```java
HologramManager manager = FancyHologramsPlugin.get().getHologramManager();
manager.removeHologram("hologram_name");
```
## JavaDocs and help
You can find the JavaDocs for the FancyHolograms API [here](https://repo.fancyplugins.de/javadoc/releases/de/oliver/FancyHolograms/latest).
Join the [FancyPlugins Discord](https://discord.gg/ZUgYCEJUEx) for help and support. There is a dedicated channel for help about the api (`#holograms-dev`).

View File

@@ -0,0 +1,5 @@
---
icon: log
order: 5
redirect: v2
---

View File

@@ -0,0 +1,7 @@
---
order: 1
---
![](../../static/changelog_v1_x_x.png)
#

View File

@@ -0,0 +1,7 @@
---
order: 2
---
![](../../static/changelog_v2_x_x.png)
#

View File

@@ -0,0 +1,5 @@
---
order: 9
icon: command-palette
redirect: hologram.md
---

View File

@@ -0,0 +1,36 @@
---
order: 9
---
![](../../static/commands.png)
# /FancyHolograms
### Version
Shows the current version of the plugin. It also shows possible updates.
- **Syntax**: `/fancyholograms version`
- **Permissions**: `fancyholograms.admin`
### Save
Saves all holograms to the file system.
- **Syntax**: `/fancyholograms save`
- **Permissions**: `fancyholograms.admin`
### Reload
Reloads the configuration and also loads all holograms from the file system.
- **Syntax**: `/fancyholograms reload`
- **Permissions**: `fancyholograms.admin`
### Convert
Converts holograms from other hologram-plugins to FancyHolograms' holograms
- **Syntax**: `/fancyholograms convert DecentHolograms <* | name of hologram> [--processIcons]`
- `--processIcons`: If set, the converter will also convert icons into separate holograms
- **Permissions**: `fancyholograms.admin`

View File

@@ -0,0 +1,217 @@
---
order: 10
---
![](../../static/commands.png)
# /Hologram
## Manage holograms
### help
Description: Shows a list of all subcommands<br/>
Syntax: ``/Hologram help``<br/>
Permission: ``FancyHolograms.admin``
### list
Description: Shows a list of all holograms<br/>
Syntax: ``/Hologram list``<br/>
Permission: ``FancyHolograms.admin``
### nearby
Description: Shows all holograms nearby you in a range<br/>
Syntax: ``/Hologram nearby <range>``<br/>
Permission: ``FancyHolograms.admin``
### create
Description: Creates a new hologram at your location<br/>
Syntax: ``/Hologram create (type) (name)``<br/>
Permission: ``FancyHolograms.admin``
### remove
Description: Removes a certain hologram<br/>
Syntax: ``/Hologram remove (hologram)``<br/>
Permission: ``FancyHolograms.admin``
### copy
Description: Creates a copy of a hologram<br/>
Syntax: ``/Hologram copy (hologram) (new name)``<br/>
Permission: ``FancyHolograms.admin``
### info
Description: Shows you all information about the hologram<br/>
Syntax: ``/Hologram info (hologram)``<br/>
Permission: ``FancyHolograms.admin``
## General hologram modification
These commands can be run for any hologram type (text, item and block).
### moveHere
Description: Teleports the hologram to you<br/>
Syntax: ``/Hologram edit (hologram) moveHere``<br/>
Alias: ``/Hologram edit (hologram) position``<br/>
Permission: ``FancyHolograms.admin``
### moveTo
Description: Teleports the hologram to the location<br/>
Syntax: ``/Hologram edit (hologram) moveTo (x) (y) (z) [yaw] [pitch]``<br/>
Permission: ``FancyHolograms.admin``
### rotate
Description: Rotates the hologram around the y-axis<br/>
Syntax: ``/Hologram edit (hologram) rotate (degrees)``<br/>
Permission: ``FancyHolograms.admin``
### rotatepitch
Description: Rotates the hologram around the x-axis<br/>
Syntax: ``/Hologram edit (hologram) rotatepitch (degrees)``<br/>
Permission: ``FancyHolograms.admin``
### visibilityDistance
Description: Sets from how far away players can see the hologram (-1 for default distance)<br/>
Syntax: ``/Hologram edit (hologram) visibilityDistance (distance)``<br/>
Permission: ``FancyHolograms.admin``
### visibility
Description: Sets how the visibility should be controlled<br/>
Syntax: ``/Hologram edit (hologram) visibility (ALL | MANUAL | PERMISSION_NEEDED)``<br/>
Permission: ``FancyHolograms.admin``<br/>
Permission to view a hologram: ``FancyHolograms.viewhologram.<name>``
### scale
Description: Sets the scale (can be floats)<br/>
Syntax: ``/Hologram edit (hologram) scale (factor)``<br/>
Permission: ``FancyHolograms.admin``
### billboard
Description: Sets the billboard<br/>
Syntax: ``/Hologram edit (hologram) billboard (center | fixed | vertical | horizontal)``<br/>
Permission: ``FancyHolograms.admin``
### shadowStrength
Description: Sets the shadow strength<br/>
Syntax: ``/Hologram edit (hologram) shadowStrength (strength)``<br/>
Permission: ``FancyHolograms.admin``
### shadowRadius
Description: Sets the shadow radius<br/>
Syntax: ``/Hologram edit (hologram) shadowRadius (radius)``<br/>
Permission: ``FancyHolograms.admin``
### linkWithNpc
Description: Links a hologram with an NPC (requires FancyNpcs)<br/>
Syntax: ``/Hologram edit (hologram) linkWithNpc (npc)``<br/>
Permission: ``FancyHolograms.admin``
### unlinkWithNpc
Description: Unlinks the hologram from the NPC<br/>
Syntax: ``/Hologram edit (hologram) unlinkWithNpc``<br/>
Permission: ``FancyHolograms.admin``
## Text hologram modification
These commands can be run for all **text** holograms.
### setLine
Description: Sets the content of the line<br/>
Syntax: ``/Hologram edit (hologram) setLine (line) (text...)``<br/>
Permission: ``FancyHolograms.admin``
### addLine
Description: Adds a line at the bottom<br/>
Syntax: ``/Hologram edit (hologram) addLine (text...)``<br/>
Permission: ``FancyHolograms.admin``
### removeLine
Description: Removes a line<br/>
Syntax: ``/Hologram edit (hologram) removeLine (line)``<br/>
Permission: ``FancyHolograms.admin``
### insertBefore
Description: Adds a line after another<br/>
Syntax: ``/Hologram edit (hologram) insertBefore (line) (text...)``<br/>
Permission: ``FancyHolograms.admin``
### insertAfter
Description: Adds a line before another<br/>
Syntax: ``/Hologram edit (hologram) insertAfter (line) (text...)``<br/>
Permission: ``FancyHolograms.admin``
### updateTextInterval
Description: Sets the interval for refreshing the text (useful for
placeholders)<br/>
Syntax: ``/Hologram edit (hologram) updateTextInterval (ticks | seconds | minutes)``<br/>
Example ticks:``/Hologram edit (hologram) updateTextInterval (15)``<br/>
Example seconds:``/Hologram edit (hologram) updateTextInterval (5s)``<br/>
Example minutes:``/Hologram edit (hologram) updateTextInterval (5m)``<br/>
Permission: ``FancyHolograms.admin``
### background
Description: Sets the background color<br/>
Syntax: ``/Hologram edit (hologram) background (color)``<br/>
Permission: ``FancyHolograms.admin``
### textShadow
Description: Enables/disables the text shadow<br/>
Syntax: ``/Hologram edit (hologram) textShadow (true|false)``<br/>
Permission: ``FancyHolograms.admin``
### brightness
Description: Changes the brightness of the hologram<br/>
Syntax: ``/hologram edit <hologram> brightness (block | sky) (0-15)``<br/>
Permission: ``FancyHolograms.admin``
### textAlignment
Description: Enables/disables the text shadow<br/>
Syntax: ``/Hologram edit (hologram) textAlignment (center | left | right)``<br/>
Permission: ``FancyHolograms.admin``
## Item hologram modification
These commands can be run for all **item** holograms.
### item
Description: Sets the hologram item you are holding in your main hand<br/>
Syntax: ``/Hologram edit (hologram) item``<br/>
Permission: ``FancyHolograms.admin``
## Block hologram modification
These commands can be run for all **block** holograms.
### block
Description: Sets the hologram block<br/>
Syntax: ``/Hologram edit (hologram) block (block type)``<br/>
Permission: ``FancyHolograms.admin``

View File

@@ -0,0 +1,55 @@
---
title: FancyHolograms
icon: image
expanded: true
order: 100
---
#
![](/static/fancyholograms/banner.png)
!!!
Simple, lightweight and feature-rich hologram plugin for Paper and Folia servers using packets.
!!!
## Features
With this plugin you can create fancy looking holograms with ease. You can customize properties like:
- **Type** (Text, Block, Item)
- **Text** (Multiple lines)
- **Position, Rotation and Scale**
- **Billboard** (Fixed, Center ...)
- **MiniMessage formatting**
- **Placeholders** (PlaceholderAPI, MiniPlaceholders)
- **FancyNpcs Integration** (hologram as display name)
- ... and much more!
## Principles
### Simple
The plugin is designed to be easy to use and understand. The commands are well-structured and the tab completion is incredibly helpful.
You can do everything in-game without the need of touching the configuration files.
All commands and features are documented in this wiki. If you have any questions, feel free to ask in the Discord server, we are happy to help you.
### Lightweight
The plugin is optimized for performance. It uses packets to send the hologram data to the clients, which is the most efficient way to do it.
The server does not have to do any additional work, which means that the plugin has a minimal impact on the server performance.
FancyHolograms does not require ANY dependencies other than Paper.
### Feature-rich
The plugin has a lot of features to offer. You can customize the holograms in many ways and create unique holograms for your server.
We are constantly working on new innovative features and improvements. If you have any suggestions, feel free to share them with us.
## Download
You can download the latest version of FancyHolograms from the following platforms:
[!button size="s" icon="download" iconAlign="left" text="Download from Modrinth" target="blank"](https://modrinth.com/plugin/fancyholograms/versions)
[!button size="s" icon="download" iconAlign="left" text="Download from Hangar" target="blank"](https://hangar.papermc.io/Oliver/FancyHolograms/versions)
How to get started with FancyHolograms? Check out [this page](getting-started.md).

View File

@@ -0,0 +1,34 @@
---
order: 6
icon: book
---
# FAQ
### How to modify each line in a hologram?
Per-line settings (such as scale or background) are not supported in FancyHolograms due to a limitation with display entities.
A separate hologram will need to be created for each line.
### How to add a blank line?
To add a blank line in a hologram, use `<r>` on a new line.
### How to make holograms clickable?
Holograms currently aren't clickable themselves, but [here's](tutorials/clickable-holograms.md) a workaround
### How to make the hologram not to rotate?
To make a hologram not rotate, the billboarding must be set to FIXED.
Example: `/holo edit <hologram> billboard FIXED`
Once complete, you must set the hologram's rotation with the rotate and rotatepitch commands.
### How to edit the holograms via the data file?
1. Run /fancyholograms save
2. Back up the holograms.yml file in case something goes wrong
3. Edit your holograms.yml file as desired
4. Run /fancyholograms reload after saving the file

View File

@@ -0,0 +1,35 @@
---
order: 10
icon: info
---
# Getting started
!!! danger
Be aware, that only Paper and Folia is supported, but the plugin should work on any of its forks (like Purpur or Pufferfish). Spigot, Bukkit, Sponge and Fabric is not supported.
!!!
## Installation
To install FancyHolograms, you need to download the latest version from one of the following sources:
[!button size="s" icon="download" iconAlign="left" text="Modrinth" target="blank"](https://modrinth.com/plugin/fancyholograms/versions)
[!button size="s" icon="download" iconAlign="left" text="Hangar" target="blank"](https://hangar.papermc.io/Oliver/FancyHolograms/versions)
After downloading the plugin, you can install it by placing the downloaded file in the `plugins` folder of your server.
Restart your server and you are ready to go!
To check if the plugin is installed correctly, you can use the command `/fancyholograms version`. If the plugin is installed correctly, it will show you the version of the plugin.
## Create your first hologram
1. To create your first hologram, you can use the command `/hologram create text myHologram`. This will create a new text hologram with the given name.
2. To add text to the hologram, you can use the command `/hologram edit myHologram addLine <green>My first hologram</green>`. This will add a new line to the hologram with the given text.
3. To edit the text of the hologram, you can use the command `/hologram edit myHologram setLine 1 <red>My first hologram</red>`. This will set the text of the first line to the given text.
4. To change the background of the hologram, you can use the command `/hologram edit myHologram background RED`. This will set the background of the hologram to red.
5. To move the hologram to your current location, you can use the command `/hologram moveHere myHologram`. This will move the hologram to your current location.
!!!
You can use MiniMessages in the hologram text. For more information about MiniMessages, you can visit the [MiniMessage documentation](https://docs.advntr.dev/minimessage/format.html).
!!!

View File

@@ -0,0 +1,34 @@
---
order: 8
icon: image
---
# Inspiration
The following examples show how to use FancyNpcs in different ways. They are meant to give you an idea of what you can do with the plugin.
Almost all examples are made by the community. If you have a nice example that you want to share, feel free come to our discord server and show it to us.
![Provided by play.freshsmp.fun](../static/fancyholograms/examples/freshsmp-1.png)
![Provided by play.freshsmp.fun](../static/fancyholograms/examples/freshsmp-2.png)
![Provided by play.freshsmp.fun](../static/fancyholograms/examples/freshsmp-3.png)
![Provided by play.freshsmp.fun](../static/fancyholograms/examples/freshsmp-4.png)
![Provided by play.freshsmp.fun](../static/fancyholograms/examples/freshsmp-5.png)
![Provided by play.silverstonemc.net](../static/fancyholograms/examples/silverstone-1.png)
![Provided by play.silverstonemc.net](../static/fancyholograms/examples/silverstone-2.png)
![Provided by https://github.com/OliverSchlueter](../static/fancyholograms/examples/oliver-1.jpeg)
![Provided by https://github.com/OliverSchlueter](../static/fancyholograms/examples/oliver-2.jpeg)
![Provided by https://github.com/OliverSchlueter](../static/fancyholograms/examples/oliver-3.jpeg)
![Provided by https://github.com/OliverSchlueter](../static/fancyholograms/examples/oliver-4.jpeg)
![Provided by https://github.com/OliverSchlueter](../static/fancyholograms/examples/oliver-5.jpeg)

View File

@@ -0,0 +1,11 @@
# Clickable holograms
Interactions with holograms is not a feature of FancyHolograms yet, but there is a workaround for this.
1. Create your hologram with the text you want.
2. Install [FancyNpcs](../../fancynpcs/getting-started.md)
3. Create a new npc and set the type to "INTERACTION" (`/npc type (npc name) INTERACTION`)
4. Remove the name tag of the npc (`/npc displayname (npc name) <empty>`)
5. Position the npc to the same location as the hologram (press F3+B to see the hitbox)
6. Modify the size of the hitbox to fit the hologram (`/npc attributes (npc name) set (width/height) (size)`)
7. Add an interaction action to the npc ([action system](../../fancynpcs/tutorials/action-system.md))

View File

@@ -0,0 +1,7 @@
---
order: 7
icon: mortar-board
---
# Tutorials
In this section you will find many tutorials for specific use cases and examples of how to use FancyHolograms. If you have any suggestions for tutorials, please let us know on our discord server.

View File

@@ -2,7 +2,7 @@
title: FancyNpcs
icon: accessibility
expanded: true
order: 100
order: 200
---
#
@@ -50,4 +50,4 @@ You can download the latest version of FancyNpcs from the following platforms:
[!button size="s" icon="download" iconAlign="left" text="Download from Hangar" target="blank"](https://hangar.papermc.io/Oliver/FancyNpcs/versions)
How to get started with FancyNpcs? Check out the [this page](getting-started.md).
How to get started with FancyNpcs? Check out [this page](getting-started.md).

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -40,7 +40,7 @@ Check out **[images section](#images)** down below.
## Installation
Paper **1.19.4** - **1.21.4** with **Java 21** (or higher) is required. Plugin should also work on **Paper** forks.
Paper **1.19.4** - **1.21.5** with **Java 21** (or higher) is required. Plugin should also work on **Paper** forks.
**Spigot** is **not** supported.