ServerPlayer
Link to serverplayer
Импорт класса
Link to импорт-класса
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.entity.type.player.ServerPlayer;
Extending Player
Link to extending-player
ServerPlayer extends Player. That means all methods available in Player are also available in ServerPlayer
Методы
Link to методы
Name: getPersistentData
Gets the persistent NBT data for this player.
Persistent data is kept through deaths
Returns: The persistent data for this Entity.
Return Type: MapData
ZenScript Copy// ServerPlayer.getPersistentData() as MapData
myServerPlayer.getPersistentData();
Name: updatePersistentData
Updates the persistent NBT data for this player.
Persistent data is kept through deaths
ZenScript Copy// ServerPlayer.updatePersistentData(data as MapData)
myServerPlayer.updatePersistentData({custom: "data"});
Параметр | Тип | Описание |
---|---|---|
Параметр data | Тип MapData | Описание The custom data to store. |
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название persistentData | Тип MapData | Имеет Getter true | Имеет Setter false | Описание Gets the persistent NBT data for this player. Persistent data is kept through deaths |