Jump to content

Recommended Posts

Posted

Uff dude, you don't want to begin with something easier D: To be able to "sit" in a chair you would have to modify the boundingBoxes of the Player so that Minecraftmechanics won't push them out again. The other thing to do is just placing the mob at the right position and angles and then using the PlayerAPI (no link though, google it) to modify the arms and legs. I guess :) I can't give you much detail here because I'm in kinda hurry. Maybe later.

Hope this helps a bit,

sincerely Me

Posted

This is very, very complicated.

 

The EntityMinecart code would be worth looking at, for the modification of the player model. If you want them in the block, you'll have to modify bounding boxes. If you want them on top of the block, just lock the player in place using the onEntityCollide(...) (or something like that) function in the block class.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Posted

This is very, very complicated.

Not that complicated, tbh.

 

The EntityMinecart code would be worth looking at, for the modification of the player model.

lolno, the sitting render is actually handled inside the RenderBiped and ModelBiped class, AFAIK. The entity just holds a variable for the riding / ridden Entity. The only thing worth looking at would be how to mount the player onto that minecart (generally an entity)

 

If you want them in the block, you'll have to modify bounding boxes. If you want them on top of the block, just lock the player in place using the onEntityCollide(...) (or something like that) function in the block class.

 

Or you just create a "dummy entity" which is invisible, let it place when the block is placed in the middle of the X/Z block coordinates (blockX/blockZ + 0,5) and deny despawning (canDespawn() returns false).

If he right-clicks the block, the block scans for the entity and mount the player to that entity. Make sure to make the size of the entity small enough so you can place blocks next to your block, and to prevent the entity from blocking the block highlighting, so the player can break the block.

If the player breaks the block, the entity is removed from the world (entity.setDead()).

 

Ah yeah, and don't forget to block the entitys movement!

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Ah yeah, and don't forget to block the entitys movement!

Or set noclip.

IIRC, you can still push the entity aside. Also wouldn't it just fall through the ground?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
Also wouldn't it just fall through the ground?

 

That assumes two things:

1) Gravity.  Minecraft doesn't really have....gravity.  Any object which needs to fall handles its own falling motion, there's no global gravity effect, so a no-clip entity can still say "nope, not fallin'!"

2) That no-clip ignores the ground.  It is not unreasonable to have only horizontally based collision ignoring.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

1) Gravity.  Minecraft doesn't really have....gravity.  Any object which needs to fall handles its own falling motion, there's no global gravity effect, so a no-clip entity can still say "nope, not fallin'!"

 

Off-topic question: How would one go about changing the 'gravity' of an entity? (i.e. changing the player so that they fall up, and so that the camera changed to match, or having sand fall a different direction?)

 

Could you give me a place to look, if it's too complicated to be worth your time explaining?

Posted

1) Gravity.  Minecraft doesn't really have....gravity.  Any object which needs to fall handles its own falling motion, there's no global gravity effect, so a no-clip entity can still say "nope, not fallin'!"

 

Off-topic question: How would one go about changing the 'gravity' of an entity? (i.e. changing the player so that they fall up, and so that the camera changed to match, or having sand fall a different direction?)

 

Could you give me a place to look, if it's too complicated to be worth your time explaining?

onUpdate(). There's a line where it says motionY -= 0.04 or something like that. Just change it in your onUpdate.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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

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

Announcements



×
×
  • Create New...

Important Information

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