SOLVED: Help with teleporter item

Started by Soulside on

Topic category: Help with modding (Java Edition)

Last seen on 10:46, 21. Apr 2024
Joined Jan 2024

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
SOLVED: Help with teleporter item
Sun, 01/07/2024 - 11:39 (edited)

For my Minecraft mod I am trying to make an item and block that function as a warp mechanic. When the player right clicks the block with the item, the item should store the block coordinates as a local variable, then when right clicking any other block, it teleports them back to those saved coordinates (this only works in the overworld). For some reason, my teleporter item always teleports the player to x=0 y=0 z=0, and I have no idea why. 

This is the procedure in question:
It is bound to the "right click on block" trigger on the item

Help would be much appreciated!

Literally figured it out 2 seconds later but I'll leave the solution here in case anyone has a similar problem, instead of using local variables I used NBT tags and now it works perfectly!

Edited by Soulside on Sun, 01/07/2024 - 11:39