Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15] How to fix the player's posture
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Zemelua

[1.15] How to fix the player's posture

By Zemelua, October 24, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Zemelua    0

Zemelua

Zemelua    0

  • Stone Miner
  • Zemelua
  • Members
  • 0
  • 55 posts
Posted October 24, 2020

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.

  • Quote

Share this post


Link to post
Share on other sites

Beethoven92    69

Beethoven92

Beethoven92    69

  • Dragon Slayer
  • Beethoven92
  • Members
  • 69
  • 556 posts
Posted October 24, 2020 (edited)

Entity#setPose...to see how its used to make the player lie in bed check the LivingEntity#startSleeping method

Edited October 24, 2020 by Beethoven92
  • Quote

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

A little fun project: https://www.curseforge.com/minecraft/mc-mods/two-players-one-horse

Share this post


Link to post
Share on other sites

Zemelua    0

Zemelua

Zemelua    0

  • Stone Miner
  • Zemelua
  • Members
  • 0
  • 55 posts
Posted November 18, 2020

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.

  • Quote

Share this post


Link to post
Share on other sites

Zemelua    0

Zemelua

Zemelua    0

  • Stone Miner
  • Zemelua
  • Members
  • 0
  • 55 posts
Posted November 18, 2020

 

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.

  • Quote

Share this post


Link to post
Share on other sites

Zemelua    0

Zemelua

Zemelua    0

  • Stone Miner
  • Zemelua
  • Members
  • 0
  • 55 posts
Posted November 19, 2020

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

  • Quote

Share this post


Link to post
Share on other sites

Beethoven92    69

Beethoven92

Beethoven92    69

  • Dragon Slayer
  • Beethoven92
  • Members
  • 69
  • 556 posts
Posted November 19, 2020

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

  • Quote

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

A little fun project: https://www.curseforge.com/minecraft/mc-mods/two-players-one-horse

Share this post


Link to post
Share on other sites

Zemelua    0

Zemelua

Zemelua    0

  • Stone Miner
  • Zemelua
  • Members
  • 0
  • 55 posts
Posted November 19, 2020

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.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • bleep_blops
      Forge Installation Problem

      By bleep_blops · Posted 3 minutes ago

      TYSM  
    • T1ps
      GUI Documentation

      By T1ps · Posted 19 minutes ago

      @Draco18s Ok... That's weird lmao umm is there any completed documentation for it or am I just gonna need to mess around?
    • _HungTeen_
      [1.15.2] Invalid criterion trigger

      By _HungTeen_ · Posted 33 minutes ago

      I am making a new Criterion trigger called SunAmountTrigger. First I create SunAmountTrigger class like the default did : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/advancement/SunAmountTrigger.java And then I register it in AdvancementHandler : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/advancement/AdvancementHandler.java Here is the json file of the custom advancement : https://github.com/HungTeen/pvzmod/blob/dev/src/main/resources/data/pvz/advancements/sunny_days.json But When I run mc, I didn't see the advancements and got log like this: [m[1;31m[11:11:47] [Server thread/ERROR] [minecraft/AdvancementManager]: Parsing error loading custom advancement pvz:sunny_days: Invalid criterion trigger: minecraft:sun_amount   I don't know why it's Invalid, tysm if someone can help me figure out.
    • monkeysHK
      [1.16] Transparent Picture Render in GUI

      By monkeysHK · Posted 35 minutes ago

      It was a really good reference to look at. I am trying to define a RenderState and use their constructor and their setup and clear functions. But it still wouldn't work. I don't know where the problem is. private static final RenderState.AlphaState HALF_ALPHA = new RenderState.AlphaState(0.5F); minecraft.getTextureManager().bindTexture(new ResourceLocation("minecraft", "textures/gui/widgets.png")); matrixStack.push(); HALF_ALPHA.setupRenderState(); { matrixStack.translate(instru_pos[currentNbo.ordinal()][0], instru_pos[currentNbo.ordinal()][1], 0); matrixStack.scale((255/20f)*scale, (255/20f)*scale, (255/20f)*scale); this.blit(matrixStack, 0, 0, 0, 146, 20, 20); } HALF_ALPHA.clearRenderState(); matrixStack.pop();  
    • DaemonUmbra
      Mods work in singleplayer but not in multiplayer

      By DaemonUmbra · Posted 40 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • bleep_blops
      2
      Forge Installation Problem

      By bleep_blops
      Started 4 hours ago

    • T1ps
      2
      GUI Documentation

      By T1ps
      Started Tuesday at 10:14 PM

    • _HungTeen_
      0
      [1.15.2] Invalid criterion trigger

      By _HungTeen_
      Started 33 minutes ago

    • monkeysHK
      2
      [1.16] Transparent Picture Render in GUI

      By monkeysHK
      Started Yesterday at 12:19 AM

    • __SmolMight__
      1
      Mods work in singleplayer but not in multiplayer

      By __SmolMight__
      Started 3 hours ago

  • Who's Online (See full list)

    • DaemonUmbra
    • _HungTeen_
    • c_o_w
    • Teedledee
    • Azaka7
    • AurenX
    • T1ps
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15] How to fix the player's posture
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community