java 如何从我的 Minecraft 服务器查看和编辑玩家数据的特定方面?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40410294/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I view and edit specific aspects of playerdata from my Minecraft server?
提问by Matt Brennan
I'm trying to switch my server over to a new mod pack, while keeping player inventory and a few other aspects of playerdata. I want to be able to transfer a player from one server to another, while resetting their location data. Are there specific tools I use to view and edit these values, and which files specifically under the playerdata folder would contain them?
我正在尝试将我的服务器切换到一个新的模组包,同时保留玩家库存和玩家数据的其他一些方面。我希望能够将玩家从一台服务器转移到另一台服务器,同时重置他们的位置数据。是否有我用来查看和编辑这些值的特定工具,以及 playerdata 文件夹下的哪些文件将包含它们?
To clarify, When their location data is reset I would like them to go to spawn. If it wont default, then entering a value will be a little more work, but sufficient.
澄清一下,当他们的位置数据被重置时,我希望他们去产卵。如果它不会默认,那么输入一个值会多一些工作,但足够了。
I've already transferred the playerdata into my new world file. I plan in switching the server every-so-often and allowing these item transfers quite abit, so I need to know for the future how to solve this without requiring all of my players to be coordinated during the transfer.
我已经将玩家数据传输到我的新世界文件中。我计划经常切换服务器并允许这些物品转移相当多,所以我需要知道将来如何解决这个问题,而无需在转移过程中协调我的所有玩家。
回答by Kerooker
Minecraft 1.7.6 or newer (UUID)
Minecraft 1.7.6 或更新版本(UUID)
On Minecraft 1.7.6 and above, Mojang uses a new UUID format. Use a UUID lookup tool, like http://minecraft-techworld.com/uuid-lookup-toolto determine the UUID of the player you wish to reset.
在 Minecraft 1.7.6 及更高版本上,Mojang 使用新的 UUID 格式。使用 UUID 查找工具,例如http://minecraft-techworld.com/uuid-lookup-tool来确定您要重置的玩家的 UUID。
- Make sure that the player you wish to reset is logged out of the server.
- Use FileZilla to connect to the server FTP.
- On the remote site, open the game folder.
- Open the world folder. It is usually world, unless you have changed it.
- Open playerdata.
- Simple: Delete, or download/rename and then delete, uuid.dat. Replace uuid with the UUID that you looked up.
- Advanced: Instead of deleting uuid.dat, download it to a location on your computer such as your desktop where you can easily find it.
- From NBTExplorer, press the "Open NBT Data Source" button that looks like a folder.
- Navigate to where you saved the uuid.dat file, select it, and press open.
- Scroll down untill you find the tag labeled "Pos" with 3 entries and press the "+" symbol next to it. These are the data tags that store where a player is in game.
- Double click on the tags one at a time and change their values. The tags aren't labelled, but they are X, Y, Z in that order. Y is height. Be careful what you set these numbers to as you can cause a player to spawn in the ground. I suggest setting their value to your world's spawn or a known safe coordinate location.
- Upload the uuid.dat back to your server in the same place you got it. Overwrite or delete the original one. Make sure that the player in question is not online at the time or it won't work.
- 确保您要重置的播放器已退出服务器。
- 使用 FileZilla 连接到服务器 FTP。
- 在远程站点上,打开游戏文件夹。
- 打开世界文件夹。它通常是世界,除非你改变了它。
- 打开玩家数据。
- 简单:删除或下载/重命名然后删除 uuid.dat。将 uuid 替换为您查找的 UUID。
- 高级:不要删除 uuid.dat,而是将其下载到您计算机上的某个位置,例如您可以轻松找到它的桌面。
- 从 NBTExplorer,按下看起来像文件夹的“打开 NBT 数据源”按钮。
- 导航到您保存 uuid.dat 文件的位置,选择它,然后按打开。
- 向下滚动,直到找到带有 3 个条目的标记为“Pos”的标签,然后按旁边的“+”符号。这些是存储玩家在游戏中的位置的数据标签。
- 一次双击一个标签并更改它们的值。标签没有标记,但它们按 X、Y、Z 的顺序排列。Y是高度。请注意您将这些数字设置为什么,因为您可能会导致玩家在地面上生成。我建议将它们的值设置为您的世界的重生点或已知的安全坐标位置。
- 将 uuid.dat 上传回您获得它的同一位置的服务器。覆盖或删除原来的。确保有问题的播放器当时不在线,否则将无法运行。
回答by SkullDrago
You can write a plugin, which can get all offlinePlayers() and then use a for to iterate the array to set the spawnlocation to the new one on the other pack.
您可以编写一个插件,它可以获取所有 offlinePlayers(),然后使用 for 迭代数组以将 spawnlocation 设置为另一个包上的新位置。
This you can trigger with a cmd which you code for it.
您可以使用您为其编码的 cmd 触发此操作。