PlayerDataSaveEvent
Extends Event
Implements Cancellable
Called when a player's data is about to be saved to disk.
Properties
$data
php
public \pocketmine\nbt\tag\CompoundTag $data$playerName
php
public string $playerNameMethods
__construct()
php
public function __construct(\pocketmine\nbt\tag\CompoundTag $data, string $playerName, ?\pocketmine\player\Player $player)getPlayer()
php
public function getPlayer() : ?\pocketmine\player\PlayerReturns the player whose data is being saved, if online. If null, this data is for an offline player (possibly just disconnected).
getPlayerName()
php
public function getPlayerName() : stringReturns the username of the player whose data is being saved. This is not necessarily an online player.
getSaveData()
php
public function getSaveData() : \pocketmine\nbt\tag\CompoundTagReturns the data to be written to disk as a CompoundTag
setSaveData()
php
public function setSaveData(\pocketmine\nbt\tag\CompoundTag $data) : void