I'm making a waypoint system with compass on 20w21a.
I gave to me a compass with this :

/give @p compass{waypoint: 1, LodestoneTracked: 1b, LodestonePos:{X : 0, Y: 0, Z: 0}, LodestoneDimension: ""}

And after I'm trying to modify the LodestoneDimension to match the dimension with this :

/data modify entity @p Inventory[{tag: {waypoint: 1}}].LodestoneDimension set from entity @p Dimension

But I'm getting this error : Unable to modify player data.

What am I doing wrong ?

  • The issue is exactly what the game tells you. You cannot modify player NBT. Workaround: /replaceitem – Fabian Röling May 21 at 22:21

Player NBT can't be modified because the game doesn't allow that. The /replaceitem is an exception to this rule but that won't be of much use to you since you need to get the current Dimension. You could make it so that you have to throw the compass onto a block and then modify the data like this:

/data modify entity @e[type=minecraft:item,limit=1,sort=nearest,nbt={Item:{tag:{waypoint:1}}}] Item.tag.LodestoneDimension set from entity @p Dimension
| improve this answer | |
  • Okay I see, I'll try it, thanks ! – Ayfri May 21 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.