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 ?
11 Answer
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 1