Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

nicknico00

Members
  • Joined

  • Last visited

  1. the renderViewEntity have to extend entityLivingBase, so EntityLiving is fine (better EntityFlying). I fixed the first issue: my camera didn't like rotationYaw > 360 or < 0 , so I had to adjust player's rotationYaw before to use it. Now it doesn't spin anymore . The code I used: Camera class public class MAEntityCamera extends EntityFlying { public MAEntityCamera(World p_i1595_1_) { super(p_i1595_1_); } } RenderPlayerBase class (I'm using Player API) public class MARenderPlayerBase extends RenderPlayerBase { private MAEntityCamera camera; public MARenderPlayerBase(RenderPlayerAPI renderPlayerAPI) { super(renderPlayerAPI); } @Override public void renderFirstPersonArm(EntityPlayer p_82441_1_) { World world = Minecraft.getMinecraft().theWorld; EntityPlayer player = Minecraft.getMinecraft().thePlayer; if(!(Minecraft.getMinecraft().renderViewEntity instanceof MAEntityCamera)) { //change renderViewEntity to camera if(camera != null) Minecraft.getMinecraft().renderViewEntity = camera; else { camera = new MAEntityCamera(world); camera.setPositionAndRotation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch); world.spawnEntityInWorld(camera); Minecraft.getMinecraft().renderViewEntity = camera; } } } @Override public void renderPlayer(AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) { super.renderPlayer(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); //change renderViewEntity to player when rendering in third-person if(Minecraft.getMinecraft().gameSettings.thirdPersonView > 0) Minecraft.getMinecraft().renderViewEntity = Minecraft.getMinecraft().thePlayer; } } EventHandler class public class EventHandler { @SubscribeEvent public void updateCamera(RenderHandEvent event) { if(Minecraft.getMinecraft().renderViewEntity instanceof MAEntityCamera) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; //place camera in front of players's eyes double distanceX = -0.4, distanceY = -0.5, distanceZ = 0.4; double x = Math.sin(Math.toRadians(player.rotationYaw)) * distanceX; double y = Math.sin(Math.toRadians(player.rotationPitch)) * distanceY; double z = Math.cos(Math.toRadians(player.rotationYaw)) * distanceZ; //adjust rotationYaw if(player.rotationYaw > 360) player.rotationYaw -= 360; if(player.rotationYaw < 0) player.rotationYaw += 360; Minecraft.getMinecraft().renderViewEntity.setPositionAndRotation(player.posX + x, player.posY - 1.63 + y, player.posZ + z, player.rotationYaw, player.rotationPitch); } } } It works good, but I have to optimize it because of a few problems... For example I can't interact with the blocks i see in the center of the camera, because the player is not watching exactely there, and so i often get the error: "trying to attack an invalid entity". Do you know how could I fix this? thank you very much
  2. Thank you very much! I spawned a new EntityCamera that extends EntityLiving and set the renderViewEntity to this. It works! But now the problem is: the entityCamera's position and rotation are based on player's position and rotation, and sometime, when I move my mouse to move the head in game, the camera starts spinning very fast and I can't stop it D: Do you know what it could be? And sometimes I get an error like invalid entity attacked, when I click, and it crashes. Any idea? Thank you
  3. Unfortunately i'm in 1.7.10 Any other splution?
  4. Please guys HELP MEE! I have been googling for days before I came here and I've tried almost everything, but I didn't find a way to change the third-person-camera position. What I want to do is to move it in front of the player's eyes, like it was in first person, being able to see the player's body. help please: I'm getting crazy :'( thank you in advance.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.