Posted October 24, 20205 yr 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.
October 24, 20205 yr Entity#setPose...to see how its used to make the player lie in bed check the LivingEntity#startSleeping method Edited October 24, 20205 yr by Beethoven92 Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
November 18, 20204 yr Author Looking at #setPose, It was running dataManager.set, but I'm not sure what this is doing. #set doesn't seem to be doing anything about the player's pose.
November 18, 20204 yr Author I'm sorry, I made a mistake. Looking at it, I found that I was doing something about pose with recalculateSize. I'll think about it for a moment.
November 19, 20204 yr Author 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.)
November 19, 20204 yr 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
November 19, 20204 yr Author 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.