SynchronizePosition teleports the player to the specified coordinates
(x, y, z float64, yaw, pitch float32)
| 191 | |
| 192 | // SynchronizePosition teleports the player to the specified coordinates |
| 193 | func (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 |
| 206 | func (p *Player) Login() error { |
no test coverage detected