1.14.4 Refreshing the entity metadata packet on an entity with ProtocolLib

Discussion in 'Spigot Plugin Development' started by BigPotatoBob, Feb 26, 2020.

  1. So I've been trying to make a method that makes certain entities glow for a single player only by sending a "PacketType.Play.Server.ENTITY_METADATA" packet to said player, and that so far works perfectly, I even managed to change the glow color by also sending team packets with that entity in them. It also works when trying to pass a player as the glowing entity and persists through player updated entity metadata packets.

    The real problem comes in when trying to remove said glow. Removing it from a player works fine by setting the entity packet's first bit mask to 0x00 instead of 0x40 (https://wiki.vg/Entity_metadata#Entity) which is also the same method I use to set things to glowing in the first place, but for whatever reason when I use a non player entity as parameter for the packet, it doesn't remove the glow effect. In fact, through testing I found out it just doesn't take into account the second packet I send no matter which bit mask I use, for example if I put 0x01 instead of 0x40 in the first packet, it'll set it on fire but no matter what I do with the second packet it'll stay that way untill I either reload the chunk somehow or manually make it send another entity metadata packet ingame by setting it on fire with flint and steel for example.

    So my guess is I'd have to send the player a packet that'd make the entity metadata forcefully refresh for them or something of the sort. I am also somewhat new to packets so there may have been something I forgot to think about :unsure:

    Regardless I'd definetely apreciate some help on the matter, thank you all ! ♥
  2. I am now running into a similar issue, were you able to find a way to resend/refresh the ENTITY_METADATA packet? With or without protocol lib?
  3. I'm facing that kind of problem as well. I use Protocollib to send a meta packet glowing to a specific player, however when I right click on that player the effect disappears...

    I think the solution is to cancel the packet action on the entity before it is received by the server.

  4. My problem is slightly different, I am intercepting the ENTITY_METADATA packet and modifying it between it being sent and before the player recieves it, my only issue are there are cases where the packet has already been sent without my modifications, and I need a way to force the refresh of that entity metadata packet.