VaultConfig 5.47.0
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
public const DEFAULT_ACTIVATION_RANGE = 4.0DEFAULT_DEACTIVATION_RANGE
public const DEFAULT_DEACTIVATION_RANGE = 4.5DEFAULT_LOOT_TABLE
public const DEFAULT_LOOT_TABLE = "loot_tables/chests/trial_chambers/reward.json"OMINOUS_LOOT_TABLE
public const OMINOUS_LOOT_TABLE = "loot_tables/chests/trial_chambers/reward_ominous.json"TAG_ACTIVATION_RANGE
public const TAG_ACTIVATION_RANGE = "activation_range"TAG_DEACTIVATION_RANGE
public const TAG_DEACTIVATION_RANGE = "deactivation_range"TAG_KEY_ITEM
public const TAG_KEY_ITEM = "key_item"TAG_LOOT_TABLE
public const TAG_LOOT_TABLE = "loot_table"TAG_OVERRIDE_LOOT_TABLE_TO_DISPLAY
public const TAG_OVERRIDE_LOOT_TABLE_TO_DISPLAY = "override_loot_table_to_display"Methods
__construct()
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()
public static function fromNbt(\pocketmine\nbt\tag\CompoundTag $nbt) : selfgetActivationRange()
public function getActivationRange() : floatgetDeactivationRange()
public function getDeactivationRange() : floatgetKeyItem()
public function getKeyItem() : \pocketmine\item\ItemThe 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()
public function getLootTable() : stringLoot table of the rewards (Bedrock path or Java id).
getLootTableToDisplay()
public function getLootTableToDisplay() : stringLoot table the shown item is picked from.
getOverrideLootTableToDisplay()
public function getOverrideLootTableToDisplay() : ?stringLoot table the shown item is picked from, if not the reward table.
hasKey()
public function hasKey() : boolisKey()
public function isKey(\pocketmine\item\Item $item) : boolWhether the item opens the vault (vanilla VaultBlockEntity.Server.isValidToInsert): the same item as the key, at least as many.
ominous()
public static function ominous() : selfThe config of the vaults of the ominous trial chamber rewards: an ominous trial key and the ominous rewards.
toNbt()
public function toNbt() : \pocketmine\nbt\tag\CompoundTag