SOLVED: Help with teleporter item

Started by Apollo on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2024
Points:

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:
https://imgur.com/a/ZV3fj9V
It is bound to the "right click on block" trigger on the item

Help would be much appreciated!

SOLUTION: 
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 Apollo on Sun, 01/07/2024 - 11:39