not teleporting into the ground

Started by user_25th9p7 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
not teleporting into the ground

so I made a right click ability on a sword that teleports the player 8 blocks infront of him, but it also works when they are looking down, so they will also teleport into the ground, is there a way to stop the teleport if there is a block in the way? if so, I couldnt find it 

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
by getting the block in…
Sat, 11/06/2021 - 01:07

by getting the block in front or down or up of them?

Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
probably in front, but I…
Sun, 11/07/2021 - 02:37

probably in front, but I mean when the teleport is getting the player into a wall/block it should prevent it and say a  message "blocks in the way!" 

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah, by getting block in…
Sun, 11/07/2021 - 03:12

yeah, by getting block in front, and if its solid send message?

Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ye send message and cancel…
Sun, 11/07/2021 - 13:09

ye send message and cancel the teleport