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.

Featured Replies

Posted

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:

Sprite-0001.png.4503f56fbf111fe119490a30680272be.png

I know this might take some complex maths, so thanks for your help if you know a solution!

Edited by squidlex

  • 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?

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().

  • 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!

Sprite-0001.png.35016df5603255573fa570f94c89f154.png

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.