diff --git a/docs/api/basic-usage/faq.md b/docs/api/basic-usage/faq.md new file mode 100644 index 0000000..7f892f5 --- /dev/null +++ b/docs/api/basic-usage/faq.md @@ -0,0 +1,38 @@ +--- +title: FAQ +description: Common questions regarding the DecentHolograms API. +--- + +This page covers common questions about the API of DecentHolograms. Should you have a question that is not answered here, consider [joining our Discord Server](https://discord.decentsoftware.eu) and ask us there. + +## How do I only show the Hologram to specific Players? + +Showing a Hologram only to specific players through the API is a bit of effort. +A Hologram is by default displayed to everyone and just removing the players from the list of viewers won't work just like that. + +Instead, after [getting your Hologram](dhapi.md#getting-a-hologram) you have to change its default visibility state to `false`: +```java +hologram.setDefaultVisibleState(false); +``` + +After that, set the player that should be able to see the Hologram: +```java +hologram.setShowPlayer(player); +``` + +You can also remove players from the viewer list: +```java +hologram.removeShowPlayer(player); +``` + +If you want to do the oposite - show the Hologram to everyone except certain Players - can you do that too using the `setHidePlayer` method: +```java +hologram.setHidePlayer(player); +``` + +This method also has a counterpart to remove players from the list: +```java +hologram.removeHidePlayer(player); +``` + +Important to note is, that the `setDefaultVisibleState` needs to be set to `true` for the `setHidePlayer` method to work. This is the default state for a Hologram, unless you changed it. \ No newline at end of file diff --git a/docs/api/basic-usage/hologram.md b/docs/api/basic-usage/hologram.md deleted file mode 100644 index 7665052..0000000 --- a/docs/api/basic-usage/hologram.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Hologram -description: Info about the Hologram class and its methods ---- - -/// info | Work in Progress -This page is a **Work in Progress**. It may not yet contain all the info planned. - -Please check again later. -/// - -The `Hologram` class is the main class representing a Hologram on the Server and contains the different `HologramPages` and `HologramLines`. \ No newline at end of file diff --git a/docs/api/basic-usage/hologramline.md b/docs/api/basic-usage/hologramline.md deleted file mode 100644 index b0112a0..0000000 --- a/docs/api/basic-usage/hologramline.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: HologramLine -description: Info about the HologramLine class and its methods ---- - -/// info | Work in Progress -This page is a **Work in Progress**. It may not yet contain all the info planned. - -Please check again later. -/// - -The `HologramLine` class represents a Line in a Hologram Page and contains the content it displays. \ No newline at end of file diff --git a/docs/api/basic-usage/hologrampage.md b/docs/api/basic-usage/hologrampage.md deleted file mode 100644 index 8e4f67e..0000000 --- a/docs/api/basic-usage/hologrampage.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: HologramPage -description: Info about the HologramPage class and its methods ---- - -/// info | Work in Progress -This page is a **Work in Progress**. It may not yet contain all the info planned. - -Please check again later. -/// - -The `HologramPage` class represents a Page in a Hologram and contains the different `HologramLine` instances and click actions. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 5148dd8..9e7eae2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -129,9 +129,7 @@ nav: - Basic Usage: - api/basic-usage/index.md - api/basic-usage/dhapi.md - - api/basic-usage/hologram.md - - api/basic-usage/hologrampage.md - - api/basic-usage/hologramline.md + - api/basic-usage/faq.md - api/events.md - Spigot: 'http://decentholograms.eu/' - Discord: 'https://discord.decentsoftware.eu/'