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

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!

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

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

  • 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;
}

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

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

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.