Jump to content

[SOLVED]How to fix player can stand on top of my custom entity


Recommended Posts

I don't think it is normal behavior to be able to stand on top of an entity, right? Plus my custom entity can't be pushed out of the way.


Now I thought the canBePushed() method was the one that controlled this. I overrode it to set it to true but still seems to have the same behavior.


There is another method called canBeCollidedWith() but I think that also affects attacking and so don't think I should mess with that one, right?


I crawled through the vanilla code and most living entities set the canBePushed() to return !this.isDead() so returning true should be fine for my purpose.


What am I missing? In my entity I'm controlling the motion tightly, so I suspect that the problem is that when it tries to push me I'm overriding it with motion all 0. How would I let the motion from a push happen -- is there some sort of indication that it has been pushed?


If there is no indication that it is in the middle of a push, I guess it must work with a "friction" sort of mechanism. I know that vanilla does that (always multiplies motion by something like 0.93 or something). So I guess maybe I need to implement that?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

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.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

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