get filled_map nbt data in mcfunction.

To check the map in the players offhand I run: data get entity @s Inventory[{Slot:-106b}]

Player has the following entity data: {count: 1 ,Slot: -106b, components: {"minecraft:map_id": 5}, id: "minecraft:filled_map"

But .minecraft/saves/<save_file>/data/map_5.dat contains more information like:

  • dimension: minecraft:overworld
  • locked: 0
  • scale: 4
  • xCenter: -1088
  • yCenter: -1088

Is there any way to get this information in a mcfunction?

Context, what I want to achieve: When the player eats a chorus fruit, while holding a filled_map in the offhand, => teleport the player to the map's center.

Continue to help post