Wiki 9Minecraft Wiki 9Minecraft

How to Modify Player Data with the /data Command

Java EditionModGuides 4FAQ 10Related mods 48
DownloadModify Player Data Mod

Get the files on 9Minecraft

The Basic Command Shape

In vanilla Minecraft, /data only works on blocks and entities. This mod extends it so you can target players directly. The syntax mirrors the vanilla command, but you point it at a player instead of an entity selector.

To read a player's data first, run the get form of the command targeting the player by name. This shows you the NBT tree so you know exactly which tag path you want to change. Reading before writing is the single most important habit here, because guessing a tag path is the fastest way to get an error.

Writing a Value

Once you know the path, use the modify form of the command. You specify the player, the tag path inside their data, and the operation (set, merge, or append depending on what you are changing). For example, to change a simple numeric or string tag, use set with the new value.

If the command succeeds you get a confirmation message. If it fails, the error usually tells you whether the player was not found or the tag path did not exist. Check spelling of the path carefully — NBT paths are case sensitive and nested tags need the correct separators.

Always test on a copy of the world or a throwaway player before applying changes to someone's real save, since some player data tags are read at login and bad values can cause issues.

More guides for this mod