MinecraftForge icon indicating copy to clipboard operation
MinecraftForge copied to clipboard

[1.18.2] Size changes in `EntityEvent.Size` not respected in all calculations

Open Minecraftschurli opened this issue 3 years ago • 0 comments

Description of issue:

  1. Issue 1: The bounding box used to calculate if the player needs to sneak or crawl to fit in a space isn't resized.
  2. Issue 2: The bounding box used to calculate if the player can sneak isn't resized.

Both issues are caused by Entity#canEnterPose not using a modified version of the hitbox but a fresh one.

2022-06-05_23 59 14 2022-06-05_23 59 24

Steps to Reproduce:

  1. Add event listener for EntityEvent.Size and filter if it is the player
  2. Scale the hitbox by 0.5
  3. The 2 issues arise
    1. Issue 1: Expected behavior: The player can fit in a 1 or 1.5 block high space without crawling or sneaking. Actual behavior: The player instantly goes into crawl mode once walking in the 1 block high space and goes into sneak mode upon walking in the 1.5 high space
    2. Issue 2: Expected behavior: The player can sneak walking against a block. Actual behavior: The player exits sneaking mode upon colliding with the block (horizontally)

Versions:

Minecraft: 1.18.2 Forge: 40.1.0

Minecraftschurli avatar Jun 05 '22 22:06 Minecraftschurli