Jump to content

Recommended Posts

Posted

Since I am using a translator, my English may be unnatural.
I'm trying a certain block now. It uses onBlockActivated to fix the pose and coordinates of the player who right-clicked on the block. I thought the vanilla bed code might be helpful, but I couldn't find it. It would be helpful if someone could tell me.

  • 4 weeks later...
Posted

Where is the behavior when the player gets on the entity? Probably done in different classes, but I can't find all. Can anyone tell me? (Specifically, I'm trying to perform the action of sitting on a chair with onBlockActivated, but for some reason the pose is STANDING in startRiding and there is no pose called RIDING. Also, when sitting, shift I don't know how to get off at.)

Posted

Oh, so you are trying to do a block you can sit on. The animation for sitting when the player mounts on a rideable entity is handled in the LivingRenderer class, take a look there. You will see you won't have to use setPose at all. You would need to set the rider of the dummy entity you use to simulate sitting on a block to the player that right clicks on that block, then the rest is already taken care for you in the background. Take a look at how vanilla rideable entities handle mount/dismount

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted

I know that some famous mod chair blocks use mountable entities for sitting, but after this I do the same (eg right click to dance on that block). I'm planning to make a block (such as), so I want to make the code versatile. Therefore, if possible, I would like to refer to bedtime rather than riding on an entity, but the bedtime code is complicated and confusing (due to skipping time, dimming the screen, etc.).

It is now possible to teleport to the block position with setPotision by referring to the bed and riding code,

・ I can't stay there
・ I don't know how to get off when I press shift
I have these problems. I'll take a look at Living Renderer from now on.

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.