Skip to content

Commit

Permalink
Remove Hologram, HologramPage and HologramLine and add FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed Mar 7, 2024
1 parent 4208ca7 commit 886a7d8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
38 changes: 38 additions & 0 deletions docs/api/basic-usage/faq.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 0 additions & 12 deletions docs/api/basic-usage/hologram.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/api/basic-usage/hologramline.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/api/basic-usage/hologrampage.md

This file was deleted.

4 changes: 1 addition & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/'

0 comments on commit 886a7d8

Please sign in to comment.