SkytAsul / GlowingEntities

An API to easily make Minecraft entities glow. No dependencies, compatible 1.17 -> 1.21.
MIT License
62 stars 8 forks source link

Set entity's glowing color on existing team #13

Open jackson-57 opened 7 months ago

jackson-57 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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.

jackson-57 commented 7 months ago

Got it. Thanks for making GlowingEntites :)

ABluAxolotl commented 2 months ago

Has this feature been added yet? Just wondering because I'm trying to accomplish the same with our own team system, and we're running into the same problems.

SkytAsul commented 2 months ago

Unfortunately that is quite complex and I do not have time to dive into this (I do not even have time to update to 1.21 :/) The library is open source though, you can try to add it yourselves :)

ImCarsen commented 2 months ago

Unfortunately that is quite complex and I do not have time to dive into this (I do not even have time to update to 1.21 :/) The library is open source though, you can try to add it yourselves :)

All good, if we do add it ourselves, we'll make sure to make a PR.