Posted May 31, 201510 yr Hello, I am trying to create a non-living entity. I would like the player to be mounted onto this entity after the mod checks some permission stuff. I have overridden the interactFirst(EntityPlayer player) method, but it seems like it is not being called. I have noticed that when I press F3+B (to show hitboxes of entities), the hitbox seems to be correct, but I can interact with the blocks behind it; not with the actual entity. Code: http://pastebin.com/JjAJgR9f I'd appreciate any help, Thanks!
May 31, 201510 yr Author I have tried it both with and without setEntityBoundingBox(). Neither works.
May 31, 201510 yr Author It might have something to do with getBoundingBox() or getCollisionBox(). I saw minecarts used them and I'm a bit confused what the difference is to setSize(). I also noticed that attackEntityFrom() isn't being called either.
May 31, 201510 yr It might have something to do with getBoundingBox() or getCollisionBox(). I saw minecarts used them and I'm a bit confused what the difference is to setSize(). I also noticed that attackEntityFrom() isn't being called either. BounDing box is actuall entity zone. Collision box is box of collision, box with which player can interact... It being null, means that player goes, righ clicks and attacks through it... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
May 31, 201510 yr Author I added: @Override public AxisAlignedBB getCollisionBox(Entity entityIn) { return new AxisAlignedBB(posX-1, posY-1, posZ-1, posX+1, posY+1, posZ+1); } to my entity class. I can now collide with the entity, but right clicking it still doesn't do anything. Btw, I am using this to get interacts: @Override public boolean interactFirst(EntityPlayer player) { System.out.println("INTERACTTT!!!"); return true; }
June 1, 201510 yr Author Anyone? This makes no sense! I have looked at some other entity classes, and I don't see anything that could explain this. Maybe this has something do to with Forge not calling the interact method. I would really appreciate any help! Also, I'm using the summon command. Not that I see how that could influence it.
June 1, 201510 yr Author Solved! It turns out I didn't need all the bounding box stuff! Only setSize(). After adding: @Override public boolean canBeCollidedWith() { return true; } to the entity class, I could interact with it!
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.