Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to hide the hologram from all players #14

Closed
AerWyn81 opened this issue Jun 26, 2022 · 3 comments
Closed

Ability to hide the hologram from all players #14

AerWyn81 opened this issue Jun 26, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@AerWyn81
Copy link

Hello, great resource!

Is there any way to add a method in Hologram to choose to hide or show the hologram to all players by default (ex: hologram.setVisibleByDefault(false)) ?

In my case, I want to create a hologram, hide it from all players (and those who will join later) and under certain conditions display it to some players.

Is this kind of functionality implementable?

Thanks :)

@unldenis
Copy link
Owner

unldenis commented Jun 26, 2022

Thanks to the latest commit you can do it!
When a player joins the server you simply add him to the excluded players.
So to show only certain players just remove them from the excluded players!

You can see a simple example here.

@unldenis unldenis added the enhancement New feature or request label Jun 26, 2022
@AerWyn81
Copy link
Author

Hi,

Thanks for the quick response and addition!

So if I want to hide the hologram from all players, when I create my hologram, I have to store the hologram list and get the list for each connected players and then add them to the "excludedPlayers" for each hologram?
Then when others players will join, I have to add it to excludePlayers?

I find this heavy....
Wouldn't it have been easier if the api had handled this behavior?
To have the option on the hologram by default according to a method directly on the hologram as on the example of my first message and to manage the show/hide afterwards?

If I had some freetime I would have made a PR to try but I'm a bit busy at the moment.
If it's not possible, I'll deal with it no worries!

Thank you again for your rapidity :)

@AerWyn81
Copy link
Author

Hi, my previous comment was not necessary sorry, by taking it back much later, I could do what I wanted, perfect!

I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants