Bounding boxes on animated blocks

Started by Joe_Schmoe on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Bounding boxes on animated blocks
Mon, 09/23/2024 - 01:40 (edited)

I have created a geckolib animated block. I would like to adjust the bounding boxes using blockstates to fit the animation as it plays but the bounding boxes do not work, I can just walk through them.  Is this a known incompatibility or is there something I can do to get this to work?

Edited by Joe_Schmoe on Mon, 09/23/2024 - 01:40
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I dont think you can make…
Tue, 09/24/2024 - 01:34

I dont think you can make the bounding box change depending on the animation. You can make the bounding box encapsulate the whole area where the block would animate to. If you really need it you can make a seperate block which replaces the animated one as soon as the animation finishes with the needed bounding box. 

Using the blockstates plugin you can make new bounding boxes. There shouldnt be any issues. Are you sure your changing the blockstates correctly in your procedures.

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much for your…
Tue, 09/24/2024 - 22:12

Thank you so much for your reply. The main problem is that I can walk through the bounding box of geckolib animated blocks. I want to set it so that the animation plays when they walk on it but the player just falls through. 

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think I've got a…
Wed, 09/25/2024 - 02:10

I think I've got a workaround, which might be close to what you suggested. Regular blocks can have blockstates that can change its bounding box. I've created a block that places the animated block when placed. Then when you walk on the regular block it triggers the animation of the animated block and adjusts its own blockstates over the animated block as the animation plays.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If it works then it works.
Wed, 09/25/2024 - 23:56

If it works then it works.

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Didn't work.  The bounding…
Thu, 09/26/2024 - 00:59

Didn't work.  The bounding boxes let you walk through them even with a generic model.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did you try making 3…
Sat, 09/28/2024 - 01:08

Did you try making 3 blockstates. The 1st one of the block before the animation with its normal bounding box. Then the 2nd one of the geckolib block which animates on whatever trigger. Where the 2nd block has the bounding box of the block after the animation.

Then once the animation is finished the final block will be the block at the end of the animation. And will have the same bounding box as the 2nd one. The 3rd blockstate I guess is optional.

You would need to make it so on trigger the block changes blockstates, animates and then changes again. For this you would probably need to time the animation to get the block to change smoothly. I dont see how this wouldnt work but it could just be a problem with the geckolib plugin.

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for your reply.  Yes…
Sat, 09/28/2024 - 12:13

Thanks for your reply.  Yes that is what I tried to do.  Changing blockstates to change bounding boxes to match the animation seems like the fix, the problem is that I just fall through the bounding boxes.  Can someone tell me, if you create a 3x1x3 block in blockbench, import it to MCreator, and try to set a bounding box to match its shape, can you walk on it or do you fall through the corner blocks?  Or is this just a problem I am having?

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When a bounding box is…
Sat, 09/28/2024 - 13:57

When a bounding box is larger than a single block then the block can only be broken when looking at the actual block x y z. However I have an animated block which is 2x2 blocks but is centered on a single block and my bounding box is fine, however it is stationary and the blocks animation is idle. So I dont see why a 3x1x3 block wouldnt act the same.

As I said it may just be a problem with the plugins. Have you tried making 3 seperate blocks and replacing each other when you want the animation to play etc without using the blockstates plugin. Cause if that works then its probably the plugins fault.