Pushing Entity away from block

Started by CptPICHU on

Topic category: Help with modding (Java Edition)

Last seen on 23:36, 4. Dec 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Pushing Entity away from block

Hey there!

So i made a block and linked a procedure to it, that triggers when something walks on it.

 

I simply want the entity that walked on the block to slightly get pushed back. Important part is: It must push exactly the opposite of the entitys walking direction.
So how can i pull this off? Theres the velocity-thing to move entitys but i'm not sure how to use it here.

Last seen on 17:06, 2. Aug 2022
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
overwrite the motion vector…
Tue, 11/23/2021 - 13:49

overwrite the motion vector of that entity by vx: playerX - blockX; vy: playerY - blockY; vz: playerZ - blockZ

I also recommend multiplying that value  

Last seen on 19:33, 16. Apr 2023
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
DumbPocket, what is -block?…
Fri, 10/21/2022 - 23:10

DumbPocket, what is -block? does that mean the block that the player is on? doesn that mean the block that the player is looking at? what block? have you tried building it and taking a screenshot?