Called when a player's data is about to be saved to disk.
Definition at line 35 of file PlayerDataSaveEvent.php.
◆ __construct()
pocketmine\event\player\PlayerDataSaveEvent::__construct |
( |
protected CompoundTag | $data, |
|
|
protected string | $playerName, |
|
|
private ?Player | $player ) |
◆ call()
pocketmine\event\Event::call |
( |
| ) |
|
|
inherited |
Calls event handlers registered for this event.
- Exceptions
-
RuntimeException if event call recursion reaches the max depth limit
Definition at line 49 of file Event.php.
◆ getEventName()
pocketmine\event\Event::getEventName |
( |
| ) |
|
|
finalinherited |
◆ getPlayer()
pocketmine\event\player\PlayerDataSaveEvent::getPlayer |
( |
| ) |
|
Returns the player whose data is being saved, if online. If null, this data is for an offline player (possibly just disconnected).
Definition at line 66 of file PlayerDataSaveEvent.php.
◆ getPlayerName()
pocketmine\event\player\PlayerDataSaveEvent::getPlayerName |
( |
| ) |
|
Returns the username of the player whose data is being saved. This is not necessarily an online player.
Definition at line 58 of file PlayerDataSaveEvent.php.
◆ getSaveData()
pocketmine\event\player\PlayerDataSaveEvent::getSaveData |
( |
| ) |
|
◆ hasHandlers()
static pocketmine\event\Event::hasHandlers |
( |
| ) |
|
|
staticinherited |
Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.
Usage: SomeEventClass::hasHandlers()
Definition at line 77 of file Event.php.
◆ isCancelled()
pocketmine\event\Cancellable::isCancelled |
( |
| ) |
|
|
inherited |
Returns whether this instance of the event is currently cancelled.
If it is cancelled, only downstream handlers that declare @handleCancelled
will be called with this event.
◆ setSaveData()
pocketmine\event\player\PlayerDataSaveEvent::setSaveData |
( |
CompoundTag | $data | ) |
|
◆ $eventName
string pocketmine\event\Event::$eventName = null |
|
protectedinherited |
The documentation for this class was generated from the following file: