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.

snow_56767

Members
  • Joined

  • Last visited

Everything posted by snow_56767

  1. Ok, I am currently trying to use world.getEntitiesWithinAABBExcludingEntity(Entity, AxisAlignBB) and player.canEntityBeSeen(Entity) I am having a little trouble though with these, I'm not entirely sure what I'm doing because nothing is documented beyond simple, half-done dyoxygen comments. So I'm a little confused as to why it's not returning anything (an empty list). Here is the code: // -- irrelevent stuff up here -- // double nScalar = 50D; Vec3 vLook = aPlayer.getLook(1F); Vec3 vPos = aPlayer.getPosition(1F); Vec3 vTarget = vPos.addVector(vLook.xCoord * nScalar, vLook.yCoord * nScalar, vLook.zCoord * nScalar); List EntList = aWorld.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(vPos.xCoord, vPos.yCoord, vPos.zCoord, vTarget.xCoord, vTarget.yCoord, vTarget.zCoord)); // -- irrelevent stuff down here -- // Also, why does rayTrace(double, float) not return any entities? That seems a little backward
  2. Hi guys, I am developing a mod that allows the player to use items on mobs from afar (things like they can insta-lasso the mob without getting to close) I am currently having trouble with actually getting the mob though. I have tried using the rayTrace method (part of EntityLivingBase) but it never returns an entity. It only ever returns a block position even though the player is clearly looking at the mob. I actually went so far as to bury my face in the mob and yet to no avail. Is there a better way of doing this? (getting an entity being looked at) What am I doing wrong? Thanks for helping NOTE: I have searched the forums (both forge and minecraft forums) and found little to nothing. And minecraft doesn't exactly have documentation.... Some code for reference: MovingObjectPosition mvObjPos = aPlayer.rayTrace(100D, 1F); // aPlayer is type EntityPlayer. if (null == mvObjPos) { return aItemStack; // aItemStack is type ItemStack. } else { if (mvObjPos.entityHit instanceof EntityLiving) { // -----------------It does continue on, I thought this would be sufficient though.----------------//

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.