How to make it so that a potion effect teleports you to the nearest structure.

Started by Brohamster on

Topic category: Help with modding (Java Edition)

Last seen on 00:50, 23. Jul 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make it so that a potion effect teleports you to the nearest structure.

I'm trying to make a mod where there are NPC police that arrests you and when they arrest you I want it to teleport you to a prison structure. I don't know how to teleport players to structures but if anyone could help me I would be grateful. Thanks for reading this. 

Last seen on 04:26, 24. Apr 2024
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This will only work if you…
Sat, 07/02/2022 - 21:18

This will only work if you have specific coords for the prison: let's say you have a prison structure that always spawn at 250 60 250(thats the coords you set for the structure), You enter the prison, and locate the coords of a cell, the Structure spawn is 250 60 250, but the first cell of the prison is 270 60 260, then just do that when the NPC arrest the player, the player get teleported to 270 60 260, which is the the coords of the first cell.

Last seen on 00:50, 23. Jul 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey like a hour before you…
Sun, 07/03/2022 - 02:01

Hey like a hour before you responded i figured that out but thanks for replying!