Pushing Entity away from block

Started by CptPICHU on

Topic category: Help with Minecraft modding (Java Edition)

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.

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  

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?