Posted September 18, 20205 yr Right now to get the space behind the player I am creating the AABB: AxisAlignedBB playerAABB = player.getEntityBoundingBox(); Vec3d lookVecBehind = Vec3d.fromPitchYaw(0f, player.rotationYaw).scale(-0.25f); AxisAlignedBB wallCheck = new AxisAlignedBB(player.posX + lookVecBehind.x, playerAABB.minY, player.posZ + lookVecBehind.z, player.posX + lookVecBehind.x, playerAABB.minY, player.posZ + lookVecBehind.z).grow(ModConfig.otherMovement.wallJump.angle, 0.5, ModConfig.otherMovement.wallJump.angle); The issue is that this is a perfect square, whereas I want to make it a rectangle with the longest side going away from the player as so: I know this might take some complex maths, so thanks for your help if you know a solution! Edited September 18, 20205 yr by squidlex
September 18, 20205 yr You cannot rotate an AxisAlignedBB, as the name suggests, it will always be axis aligned.
September 18, 20205 yr Author 4 minutes ago, vemerion said: You cannot rotate an AxisAlignedBB, as the name suggests, it will always be axis aligned. Ah, that's annoying. Do you know if there is anyway I can detect for a block in the area highlighted in red anyway?
September 18, 20205 yr 1 minute ago, squidlex said: Ah, that's annoying. Do you know if there is anyway I can detect for a block in the area highlighted in red anyway? You could perhaps do a raytrace, with World::rayTraceBlocks().
September 19, 20205 yr Author Okay, so I'm trying to work out how to detect if there is a block in the shaded red area. Thanks to the massively helpful vemerion I'm now trying to raytrace this area, but I'm struggling getting it to work. Does anyone have any tips/pointers? I'm not really sure how to set up World.rayTraceBlocks(Vec3D(), Vec3D) as whenever I put in the Player's location for one vector and the player's location + a value for the other it doesn't work. Here's what I'm trying to achieve, where X and Y are both configurable lengths, this is really throwing my head so thanks so much for your help!
September 20, 20205 yr Hmm, in what way is the raytrace not working? Is it not detecting any blocks? What Minecraft version are you using? In 1.15 at least, you have to specify more parameters.
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.