I have an Item with varying Textures like the compass or the clock, and I want it to change it's texture if the player gets within a certain horizontal distance (lets say 50 blocks) of a certain block. Now please correct me if I am wrong but I think the best way to do this is by letting the Block (or better said the TileEntity of it), while it is loaded constantly check any players in that distance and then their inventory, for that item. If it finds that item, it sends a data packet to set a boolean in that item to true, to change texture.
Now how would I begin to send this data to the itemstack, would nbttags be what I want? But if I understand nbttags correctly, I can only have a very limited amount of them, I'll be reading about nbttags more while trying to solve this, but any help would be very appreciated.
Also how would i even change the nbt tag of the itemstack in the players inventoy?
Thanks in advance!