-
Notifications
You must be signed in to change notification settings - Fork 5
Loot Statues
Loot Statues return from Vault Hunters 2nd Edition and now have 4 obtainable variants!
Each Statue comes with its own texture, shape and Configs for their items.
Upon being placed for the first time without a Loot item in its NBT, it will open up a menu for players to be able to select 5 different options that are defined in it's configuration file. Upon choosing, the data is written to the block and a skin is chosen, either from a configuration file or from the known users of the server.
If the Statue has been placed and it is crouch-clicked by a player, a new menu will open for them to rename the Player Statue to what they would like it to be called, this will also update the skin of the Statue.
Upon being placed and the item selected, it will attempt to insert items into an ItemHandler below it, this may be a chest, a hopper, a barrel, or really anything that can hold items.
For each outputted item, based on an interval that is configurable in its respective Config file, it reduces the itemsRemaining counter, if that counter reaches 0, the statue will stop generating and the nametag will signify if the statue is dead.
The item for the statues will also signify the name, the generating item of the statue and its status.

Statues can currently only be obtained through two ways, via the command /grantLootStatue {STATUE_TYPE} {STATUE_NAME} which grants you a statue of whichever statue type you selected and the name of the statue. This command requires certain permissions, so not everybody can run this. It is mainly intended to be used alongside Streamer Integration.
The other way of obtaining would be via other creative-only options, such as /give and getting the block from Creative Mode.
- The configuration for this block lies in the
config/the_vaultdirectory, calledvaultadditions_statue_{STATUE_TYPE}.json, 4 Configs for each statue type.
{
"LOOT": [
{
"value": {
"ITEM": "the_vault:abyssal_ichor",
"NBT": "{}"
},
"weight": 1
},
{
"value": {
"ITEM": "the_vault:vault_diamond",
"NBT": "{}"
},
"weight": 2
}
],
"INTERVAL": 400,
"MIN_ITEM_GENERATED": 50,
"MAX_ITEM_GENERATED": 250
}
- An Example Config file, where theres a 33.3% Chance to get an Abyssal Ichor, and a 66% to get a Vault diamond for each item Generation
- Items are defined in the
LOOTlist, as seen in the example, optionally you may provide NBT data to the generated items - The
INTERVALconfig defines the amount of ticks to wait until a new Item is generated in ticks - The
MIN_ITEM_GENERATEDandMAX_ITEM_GENERATEDconfig values define the min/max items a statue of this type can generate, this value is chosen upon the block being placed for the first time.
These are the available configs for their respective statue types:
vaultadditions_statue_arena.jsonvaultadditions_statue_gift.jsonvaultadditions_statue_mega_gift.jsonvaultadditions_statue_vault.json
- Each Block is a facing block
- Each Block has its own VoxelShape for all 4 directions
- Upon being placed, it checks if the statue does not contain the BlockEntityTag
LootItem, if this is the case the statue does nothing when being placed, otherwise it generates the options for the respective statue types and serializes each option to the NBT data. If the BlockEntityData does NOT contain thePlayerNicknametag, it will set the name to a randomly provided username from either the known users of the server, OR thevaultadditions_name_provider.jsonconfig file. Following this, it opens a LootStatueContainer and lets the player select the statue options. - Upon being right-clicked while crouching, it opens a new Menu to rename the name of the Statue.
- Upon being destroyed, it generates its own ItemStack that writes the BlockEntity data to the item, the default drop for the Block is removed to not generate two items upon being broken.
- The Statues make use of a ServerTicker that is responsible for handling the item generation.