Jump to content

snow_56767

Members
  • Posts

    2
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

snow_56767's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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.----------------//
×
×
  • Create New...

Important Information

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