Skip to content

VaultConfig 5.47.0 ​

final class · pocketmine\block\vault\VaultConfig · source

What a vault takes and gives (vanilla VaultConfig, saved by Bedrock in the "config" tag of the block entity): the loot table of the rewards, the key item, the ranges within which players make it active, and an optional loot table for the item it shows instead of the reward table. Trial chamber vaults use a trial key and chests/trial_chambers/reward, ominous ones an ominous trial key and chests/trial_chambers/reward_ominous.

Constants ​

DEFAULT_ACTIVATION_RANGE ​

php
public const DEFAULT_ACTIVATION_RANGE = 4.0

DEFAULT_DEACTIVATION_RANGE ​

php
public const DEFAULT_DEACTIVATION_RANGE = 4.5

DEFAULT_LOOT_TABLE ​

php
public const DEFAULT_LOOT_TABLE = "loot_tables/chests/trial_chambers/reward.json"

OMINOUS_LOOT_TABLE ​

php
public const OMINOUS_LOOT_TABLE = "loot_tables/chests/trial_chambers/reward_ominous.json"

TAG_ACTIVATION_RANGE ​

php
public const TAG_ACTIVATION_RANGE = "activation_range"

TAG_DEACTIVATION_RANGE ​

php
public const TAG_DEACTIVATION_RANGE = "deactivation_range"

TAG_KEY_ITEM ​

php
public const TAG_KEY_ITEM = "key_item"

TAG_LOOT_TABLE ​

php
public const TAG_LOOT_TABLE = "loot_table"

TAG_OVERRIDE_LOOT_TABLE_TO_DISPLAY ​

php
public const TAG_OVERRIDE_LOOT_TABLE_TO_DISPLAY = "override_loot_table_to_display"

Methods ​

__construct() ​

php
public function __construct(string $lootTable = self::DEFAULT_LOOT_TABLE, float $activationRange = self::DEFAULT_ACTIVATION_RANGE, float $deactivationRange = self::DEFAULT_DEACTIVATION_RANGE, ?\pocketmine\item\Item $keyItem = null, ?string $overrideLootTableToDisplay = null)

fromNbt() ​

php
public static function fromNbt(\pocketmine\nbt\tag\CompoundTag $nbt) : self

getActivationRange() ​

php
public function getActivationRange() : float

getDeactivationRange() ​

php
public function getDeactivationRange() : float

getKeyItem() ​

php
public function getKeyItem() : \pocketmine\item\Item

The key: an item of the same type is taken from the player (as many as the count of this item). A vault without a key (air) never opens.

getLootTable() ​

php
public function getLootTable() : string

Loot table of the rewards (Bedrock path or Java id).

getLootTableToDisplay() ​

php
public function getLootTableToDisplay() : string

Loot table the shown item is picked from.

getOverrideLootTableToDisplay() ​

php
public function getOverrideLootTableToDisplay() : ?string

Loot table the shown item is picked from, if not the reward table.

hasKey() ​

php
public function hasKey() : bool

isKey() ​

php
public function isKey(\pocketmine\item\Item $item) : bool

Whether the item opens the vault (vanilla VaultBlockEntity.Server.isValidToInsert): the same item as the key, at least as many.

ominous() ​

php
public static function ominous() : self

The config of the vaults of the ominous trial chamber rewards: an ominous trial key and the ominous rewards.

toNbt() ​

php
public function toNbt() : \pocketmine\nbt\tag\CompoundTag

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.