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

Started by Brohamster on Sat, 07/02/2022 - 19:09

Topic category: Help with modding (Java Edition)

Last seen on 20:11, 7. Aug 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make it so that a potion effect teleports you to the nearest structure.
Sat, 07/02/2022 - 19:09

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 18:15, 8. Aug 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 20:11, 7. Aug 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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!