#ProtocolLib, what's the right packet for entity movement<

1 messages · Page 1 of 1 (latest)

timber condor
#

Hi, problem with my understanding of packets/ProtocolLib.

Basically, I am listening to PacketType.Play.Server.REL_ENTITY_MOVE. And it works fine for mobs, but somehow it doesn't catch any player movement? (I am printing entityId's of all enitites that are moving on the server to the console, and the player Id is never among them)

quaint rock
#

I mean, there is an event for players

wispy mauve
#

Well

#

Let's think about it for a second

timber condor
#

i can see player movement by doing PacketType.Play.Client.POSITION

#

but that is serverbound

wispy mauve
#

Play.Server is sent by the server, to other players

#

Play.Client is sent by the client, to the server

#

So if you only have one player, REL_ENTITY_MOVE might not be the thing for you

quaint rock
#

Oh yeah

wispy mauve
#

Try with two accounts

quaint rock
#

^

#

the server won't send player movement to the player moving

timber condor
#

yeah but server not only receives player movement but must also surely send it to other players, right? so other players would see the movement

quaint rock
#

Yes but you need other players online for that

timber condor
#

oh

#

I haven't thought of that

#

thank you guys

timber condor
#

One more followup question: Do I need to listen to all three packets: Position, Position and Rotation, Rotation? Or can I listen only to "Position and Rotation" or only the other two? @quaint rock @wispy mauve

wispy mauve
#

uhh

#

I know that on newer NMS versions it's all just one big class with subclasses for each

#

I'd listen to them separately to ensure multi-version compat

timber condor
#

i'm basically making the plugin 1.19.4+