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

Set entity's glowing color on existing team #13

Open
jackson-57 opened this issue Jan 29, 2024 · 6 comments
Open

Set entity's glowing color on existing team #13

jackson-57 opened this issue Jan 29, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@jackson-57
Copy link

Hi. We'd like to set a entity as glowing with a specific color. Initially, we tried using GlowingEntities#setGlowing, which partially worked and was the right color, but the team created by the library conflicted with the per-player teams we're creating in our own plugin. We then tried passing the team ID into the setGlowing method, which prevented the conflict, but the color was not used for the glowing effect, instead using the existing team's color. Our workaround is to set the color for the team in our plugin, which has the disadvantage of being visible to other players. Is there a better way to accomplish this using your library, or is this the best option given the limitations of the team system?

Let me know if I can elaborate. Thanks.

(cc @Molten57)

@SkytAsul
Copy link
Owner

The color is tied to the team. Either you use the pre-made color system of GlowingEntities, which overrides the player's team, either you modify the pre-existing player's team to change its color.

@jackson-57
Copy link
Author

To confirm, there's no way GlowingEntities could override the color of the pre-existing team? GlowingEntities' packet based solution is definitely preferable to the workaround we came up with, which modifies the team's color directly on the server.

@SkytAsul
Copy link
Owner

If the pre-existing team is shared between X players and the viewers are Y, then all Y players will see the X players with the new color.

@jackson-57
Copy link
Author

That'd be fine. We only have one player on each team. It's just that when we pass in both the color and the team ID to setGlowing, the glowing color doesn't change (as in, the color argument seems to be ignored when the team ID is provided).

It might help if I elaborate further:
We have a team for each player, with the team name used to prefix the player's name for important information. The teams are left with the default white color. If we use setGlowing with just the entity, receiver, and color arguments, the player glows with the specified color, but their team name prefix disappears, since the player's team is completely overridden. If we instead use setGlowing with the entity ID, team ID, receiver, and color arguments (passing in our own team ID), the player glows and the team name prefix remains, but the player glows without the specified color, instead glowing the default white color of the existing team. Assuming this isn't the intended behavior, I'd expect the provided team's color (and therefore the glowing color) to change for just the receiver, but it doesn't change at all. Our workaround is to set the existing team's color directly, but since we're not using packets, the color change is visible to everyone, not just the receiver.
I guess my question is whether what I'm describing is intended behavior, and if not, if it's something that could be implemented into GlowingEntities.

I hope that helps clarify what I'm asking.

@SkytAsul
Copy link
Owner

Oh thank you that's very clear!
Well, I thought I had managed the case of color with an existing team but actually I just checked and no... this is something I have to add.

@SkytAsul SkytAsul added the enhancement New feature or request label Jan 31, 2024
@jackson-57
Copy link
Author

Got it. Thanks for making GlowingEntites :)

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