Closed EmporiumPvP closed 1 year ago
There is currently no API method to access vaults of a player. For now, you may execute $player->chat("/pv {$number}");
ok thanks
I've introduced a few API methods in v3.5.0. This method should be sufficient for your use-case:
/** @var Player $player */
/** @var PlayerVaults $plugin */
$plugin = Server::getInstance()->getPluginManager()->getPlugin("PlayerVaults");
$plugin->openVaultWithPermission($player, $player->getName(), 1);
README contains some more example API usages: https://github.com/Muqsit/PlayerVaults#example-api-usage As poggit is down, you may use the phar file linked with the tag v0.3.5: https://github.com/Muqsit/PlayerVaults/releases/tag/v3.5.0
thank you I appreciate it
i think the phar is messed up, if i use the source code it works fine but with the phar it cant find anything
An IDE wouldn't be able to resolve the exact type of $vaults
in this context unless you write a PHPDoc type:
use muqsit\playervaults\PlayerVaults;
...
/** @var PlayerVaults $vaults */
$vaults = Server::getInstance()->getPluginManager()->getPlugin("PlayerVaults");
How can i send a vault to a player when they click on an item in an invmenu? i tried using the API from the plugin but idk what dataFolder, file or resourceProvider is