How to detect the surface so when I teleport I'm not in the air or stuck in the wall/ground

Started by Crimbo on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect the surface so when I teleport I'm not in the air or stuck in the wall/ground
Sun, 01/21/2024 - 16:15 (edited)

Trying to make tardis mod but when i land it the tardis is either stuck in the air or buried in the ground/suffocating in a wall

 

is there a way to detect a floor to land on so i can land safely? 

 

i would request a picture of the procedure if anyone chooses to help as im quite awful at following written instructions

 

thanks Crimbo

Edited by Crimbo on Sun, 01/21/2024 - 16:15
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When it teleports you, pick…
Sun, 01/21/2024 - 18:53

When it teleports you, pick a nearby random block and check if it is air, and if it is, check if the block below it is not air. If both are true, teleport the player there.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
genious  
Sun, 11/24/2024 - 16:01

genious