Jump to content

Keybind info sending


david476

Recommended Posts

Could somebody point me in the right direction for using key binding to control entities? (Haven't used packets except for TEs and DataWatchers)

 

Also, is there a way to access vanilla keybinds, I want to use WASD while mounted but my own override vanilla's (mod works but you can't walk)

Link to comment
Share on other sites

All key input is client-side only; vanilla keybindings are accessed via the game settings:

Minecraft.getMinecraft().gameSettings.keyBindForward/Back/Left/Right.

 

You can use KeyInputEvent to listen for the vanilla movement keys being pressed and send appropriate custom packets if the client player is riding your custom entity, which would basically just add velocity to it (which is usually even done from the client side - heck, you might not even need packets if you are only modifying movement).

 

Anyway, I'd look at the Horse / Pig and see how they do it.

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.

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.