Sandertv / mcwss

A websocket server for Minecraft Bedrock Edition
https://godoc.org/github.com/Sandertv/mcwss
MIT License
114 stars 25 forks source link

Can not use player.Rotation #9

Open and7ey opened 4 years ago

and7ey commented 4 years ago

Here is the code -

          player.Rotation(func(rotation float64){
                //  fmt.Printf("  player rotation: %v\n", rotation)
            })          

The error is [LSP: Go compiler] player.Rotation undefined (type *mcwss.Player has no field or method Rotation)

and7ey commented 4 years ago

Btw, is there any way to get not only Y-rotation, but X-rotation also?

Sandertv commented 4 years ago

I think that method wasn't included in the last version. Please try updating to 1.2.0 and try again.

As for the X-rotation, unfortunately this doesn't seem to be exposed. (Or wasn't last I tried anyway) I was looking for ways to get the X-rotation so you can calculate the target block of a player, but to no avail.