Posted May 8, 20169 yr Hello there. I Changed the camera rotation of the client player with the PlayerTickEvent, but it only works on singleplayer correctly, the camera rotation should be changed until the player is sneaking, but on the server it only works until I click a block or an entity or something like that. I think I'm missing something for server handle, but I don't know what. My code looks like this: [embed=425,349] @SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { if (event.phase == TickEvent.Phase.END || event.player == null) { return; } // Once every second if (++this.serverTickCounter >= 20)//20 { this.serverTickCounter = 0; if(event.player.isSneaking()) event.player.setPositionAndRotation(event.player.posX, event.player.posY, event.player.posZ, 10, 10); //10, 10 just looking if it works } ++this.playerTickCounter; } [/embed]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.