Skip to content

PlayerResourcePackOfferEvent ​

class · pocketmine\event\player\PlayerResourcePackOfferEvent · source

Extends Event

Called after a player authenticates and is being offered resource packs to download.

This event should be used to decide which resource packs to offer the player and whether to require the player to download the packs before they can join the server.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\PlayerInfo $playerInfo, array $resourcePacks, array $encryptionKeys, bool $mustAccept)

addResourcePack() ​

php
public function addResourcePack(\pocketmine\resourcepacks\ResourcePack $entry, ?string $encryptionKey = null) : void

Adds a resource pack to the top of the stack. The resources in this pack will be applied over the top of any existing packs.

getEncryptionKeys() ​

php
public function getEncryptionKeys() : array

getPlayerInfo() ​

php
public function getPlayerInfo() : \pocketmine\player\PlayerInfo

getResourcePacks() ​

php
public function getResourcePacks() : array

mustAccept() ​

php
public function mustAccept() : bool

setMustAccept() ​

php
public function setMustAccept(bool $mustAccept) : void

setResourcePacks() ​

php
public function setResourcePacks(array $resourcePacks, array $encryptionKeys) : void

Sets the resource packs to offer. Packs are applied from the highest key to the lowest, with each pack overwriting any resources from the previous pack. This means that the pack at index 0 gets the final say on which resources are used.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.