MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / SynchronizePosition

Method SynchronizePosition

server/player/player.go:193–203  ·  view source on GitHub ↗

SynchronizePosition teleports the player to the specified coordinates

(x, y, z float64, yaw, pitch float32)

Source from the content-addressed store, hash-verified

191
192// SynchronizePosition teleports the player to the specified coordinates
193func (p *Player) SynchronizePosition(x, y, z float64, yaw, pitch float32) error {
194 p.SetPosition(x, y, z)
195 p.SetRotation(yaw, pitch)
196
197 if err := p.WritePacket(&play.SynchronizePlayerPosition{X: x, Y: y, Z: z, Yaw: yaw, Pitch: pitch}); err != nil {
198 return err
199 }
200 _, err := p.awaitPacket(play.PacketIdConfirmTeleportation)
201
202 return err
203}
204
205// Login logs the player into the game
206func (p *Player) Login() error {

Callers 1

startGameMethod · 0.95

Calls 4

awaitPacketMethod · 0.95
SetPositionMethod · 0.80
SetRotationMethod · 0.80
WritePacketMethod · 0.80

Tested by

no test coverage detected