Jump to content

Make player stand on custom entity


Recommended Posts

As part of a bigger mod that adds alot of new creatures, I wanted to add an entity that behaves just like any other entity except that the Player can stand on top of it. Pretty similar to the Shulker entity.

I already scanned the whole Shulker entity code to find what is causing the Player to be able to walk, jump and sneak on them but I cannot seem to find it. What am I missing? Or are there other ideas to add this behavior?

I already tried setting the players Y motion to 0 when colliding with the entity. As well as boosting the player up when there is the entity beneath. But nothing makes it feel like standing on a block.

Any help is much appreciated :)

Edited by Sterling00
Link to comment
Share on other sites

I found it! For everyone, its this little function:

public boolean func_241845_aY() {
   return this.isAlive();

However the name of it depends on the mapping, doesnt it? Just search for a function that does the same thing in the Shulker entity class then. Or look at entity#canCollide :)

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.