Block Rotation Help

Started by MamaLuigi on

Topic category: Help with modding (Java Edition)

Last seen on 16:47, 26. Apr 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Block Rotation Help

In my mod, i want to make it so my custom block does 3 things:

  1. If you right-click it, it will look towards you and play a sound
  2. If it is hit with a projectile, it will look in the direction the projectile came from
  3. If you are trying to break it, it will look towards you

I kinda know how the second one would work, which would be by finding the side that was hit, and changing the direction of the block so the front/face is on the same side that was hit.

And i kinda know how the first and third ones would work, which would be by doing some sort of triangle/cone detection, and if it detect a player, it will turn towards that side

 

Any help would be greatly appreciated!

 

P.S, the block has a y-axis rotation