Official page:
Bag of Holding
Features Allows players to store items in portable bags Allows limiting the number of bags players can use at once Allows placing bags into storage containers, with limits Allows placing bags inside other bags, with limits Allows restricting which items can go inside bags Allows players to upgrad...
codefling.com
About Bag of Holding
Features
- Allows players to store items in portable bags
- Allows limiting the number of bags players can use at once
- Allows placing bags into storage containers, with limits
- Allows placing bags inside other bags, with limits
- Allows restricting which items can go inside bags
- Allows players to upgrade bags linearly
- Allows using Economics and Server Rewards for purchasing bag upgrades
- Allows players to recycle bags
- Allows items to be pulled into bags automatically
- Allows unlimited types of bags to be defined, each with different appearance, capacity and rules
- Allows players to open and switch bags quickly via a UI
- Allows players to create custom key binds to open and close bags
- Allows creating bags that are preloaded with items from Kits
- Allows bags to be placed in wearable slots, including the backpack slot
- Allows a visual backpack to be displayed while the player is wearing a bag
Quick start
Give yourself a bag
- Grant the bagofholding.givebag permission to an administrator role. For example, run the command o.grant group admin bagofholding.givebag.
- Give yourself a bag with the command boh.givebag <player> generic.small (replace <player> with your in-game name). By default, this bag has 18 slots, and can hold any type of item, but it cannot hold other bags (unless those other bags are empty).
- Click on the bag in your inventory and click the "Open Bag" button. This will display the bag container in the loot panel, allowing you to place items into the bag.
Upgrade the bag
- Grant the bagofholding.upgrade.generic.small permission to an appropriate role. For example, run the command o.grant group default bagofholding.upgrade.generic.small.
- Open the bag.
- Click the "Upgrade" button.
- Click the "Purchase upgrade" button (costs 300 scrap by default). This will upgrade the bag capacity to 24 slots, and it will change the bag's appearance.
Enable gather mode
- Set Gather mode -> Enabled to true in the config.
- Reload the plugin.
- Open the bag.
- Click the "Gather: Off" button so that it changes to "Gather: On". This will show a flame icon on the bag, indicating that it is in gather mode.
- Drop and pick up an item. You will see the item get pulled into the bag automatically.
Add bags to loot tables
Note: If you are using a dedicated loot plugin to add bags to loot tables, this built-in feature might not work. For best results, configure your dedicated loot plugin to spawn bags instead.- Set Loot spawns -> Enabled to true in the config.
- For testing, set the spawn chance for one type of bag to 100.0 for the assets/bundled/prefabs/radtown/crate_normal.prefab container prefab.
- Reload the plugin.
- Spawn some containers to confirm that they can spawn bags in them. For example, run the command spawn crate_normal in the client F1 console while aiming at the ground, and look for a bag in the container.
- If none of the loot containers are spawning with a bag in them, then you are probably using a loot plugin which is conflicting, in which case you may need to configure loot spawns in your dedicated loot plugin.
- Once you have confirmed that this feature is working on your server, configure the spawn chances to your liking.
- Once you have configured the spawn chances to your liking, you can use the bagofholding.spawnloot command to spawn bags into existing loot containers according to the config. You can also remove all bags from loot containers using the bagofholding.clearloot command if you accidentally added too many.
Realistic backpacks
If you want to allow backpacks to be usable only in the backpack slot, along with a 3D visual backpack model, proceed with the following steps.- Set Wearable bags -> Allow wearing bags in the backpack slot to true in the config. This allows players to equip a bag in the backpack slot.
- Set Visual backpack -> Display while a bag is worn in the backpack slot to true in the config. This causes the visual backpack model to appear when the player is wearing a bag in the backpack slot.
- Set Player wearable bag limits -> Enabled to true in the config. This causes the player wearable inventory to have different bag limits than the rest of the player inventory.
- Set Player wearable bag limits -> Default limits -> Max total bags to 1 in the config. This allows players to wear at most one non-empty bag. Technically, this number could be set higher and it wouldn't matter, as long as you don't permit bags to be worn in other slots, since there is only one backpack slot.
- Set Player bag limits -> Default limits -> Max total bags to 0 in the config. This prevents players from placing non-empty bags in their main/belt inventory.
- Reload the plugin.
Change bag theme
By default, bags use fantasy-themed skins. Alternatively, you may choose leather-themed or tactical-themed skins. You may also choose between colored chevron icons (default) and colored circle icons which are larger and therefore easier to see. Bag skins can be directly changed in the config, but for first time users, this plugin provides multiple commands to help you edit the config in bulk.To change the bag theme, run the command boh.settheme <theme>. For example, boh.settheme tactical_chevrons. This command will update the skin IDs in the config and update existing bags in your server to the appropriate theme. Available themes are: fantasy_chevrons, fantasy_circles,leather_chevrons,leather_circles, tactical_chevrons, tactical_circles. This command works best when using a freshly generated config. If you have significantly altered the config (i.e., changed the number of bags per category), then you may have to use a lower level command such as boh.setskins, or manually update the config.
In addition to the skins assigned to the preset themes which include 6 variations (no icon, light blue, green, yellow, orange, blue), there are 5 additional colors available (gray, white, black, red, pink). See the "Alternative bag skins" section for a list of all 400+ skins. Additionally, you can create your own skins and add them to the configuration.
Some servers provide multiple themes at once, allowing players to use whichever style they prefer. To do this, you first need to define the alternative themes in the config. To add alternative themes, you can run the command boh.addtheme <theme>. Note: The fantasy_chevrons, leather_chevrons and tactical_chevrons themes are already included in the default config (as of v1.9.0), so you don't need to run this command if those are the only themes you care about, unless you are using a config from a prior version. Once the config is updated, you will then have to provide the alternative skins to your players somehow, such as via kits, vending machines, shop plugins, crafting plugins, loot plugins, etc. The boh.givebag command has an optional parameter to designate which skin to apply, which some servers use for integration with custom shops.
In addition to changing bag skins, you may also want to change the skin displayed on the belt icon via UI settings -> Belt button -> Display skin ID in the configuration. For reference, the default generic.small bag skins are 2824115881 (fantasy), 2831029422 (leather), and 2828573095 (tactical).
How it works
How players obtain bags
Bags are simply skinned large halloween loot bags (short name: halloween.lootbag.large, item ID: 479292118). Any plugin that can create skinned items can be used to make bags available on your server. For example, bags can be distributed via kits, vending machines (via Custom Vending Setup), shop plugins, crafting plugins, loot plugins (e.g., Alpha Loot), and more. The plugin also has native support for adding bags to loot containers, and provides the command boh.givebag <player> <profile> <amount> for use by admins or plugins.How players open bags
Players can open bags multiple ways."Open Bag" button: When a player clicks on a bag item, they will see the "Open Bag" button appear next to the "Drop" button. Clicking the "Open Bag" button will open the bag container on the right side of the inventory, the same as opening a storage container.
Extra belt button: Players with a bag in their inventory will see a bag button next to their belt. Clicking that button will open the first bag in their inventory (via the bag.open command). Requires "UI settings" -> "Belt button" -> "Enabled": true in the config. This is enabled by default. Subsequent presses of that button will cycle through the remaining bags in the player's inventory.
Custom key binds: Players may bind commands such as bag.open, bag.next, and bag.prev to keys for quick access. See the "Commands" section for a complete list of available commands and how they function.
Tip: Players can also move items into a bag without even opening it, by simply dragging and dropping items directly onto the bag.
Bag limits
As a balancing mechanism, you can limit how many bags a given player or container can use at once. Empty bags can be placed almost anywhere, but bags with contents will count toward a limit. When that limit is reached, empty bags in the same container will become locked and unable to receive items. The default configuration of the plugin allows players to use up to 3 bags at a time in their inventory, with 0 bags in their backpack (Backpacks plugin on uMod), and 0 bags in storage containers.To configure bag limits for player inventories, see Player bag limits in the config. To configure bag limits for Backpacks, see Backpack bag limits in the config. To configure bag limits for storage containers, see Default container bag limits and Container bag limits by prefab in the config. If desired, you can assign bag limits according to player permission.
Bag upgrades
Each bag profile may define an upgrade target, dictating which bag profile it can be upgraded to. While a player is looting a bag, if they have permission to upgrade that bag, they will see an "Upgrade" button. Clicking that button will display the cost, as well as what the bag will be upgraded to, allowing the player to confirm the purchase if they have sufficient funds.Tip: One immersive upgrade technique is to set the upgrade cost to another instance of the same bag, to make it so players have to combine bags together to produce a better bag.
Bag recycling
Each bag profile may define a set of ingredients that it will recycle into when processed by a recycler. Each bag can recycle into as many ingredients as you want, each with an optional skin ID.Tip: One immersive recycling technique is to configure larger bags to recycle into smaller bags (possibly multiple). This technique can be used to allow players to effectively reverse bag upgrades, as well as to split larger bags into smaller bags that the player can then upgrade independently.
Wearable bags
To free up main inventory space, you can enable players to carry bags in their wearable inventory slots. To enable, see Wearable bags in the config. Note: Wearing a bag will only display the visual backpack if the visual backpack is also enabled.Visual backpack
To increase immersion, you can display a visual backpack while a player is wearing a bag. To enable, see Visual backpack in the config.Gather mode
To optimize player looting, players can enable gather mode for each bag. While gather mode is enabled, any item that gets added to the bag's parent container will automatically be moved into the bag if possible. For example, if you have a Food & Medical bag in your inventory, and that bag is in gather mode, picking up a food or medical item (or moving such an item from a container to your inventory) will automatically move that item into the bag if there is space.Notes:
- Gather mode can be enabled by setting Gather mode -> Enabled to true in the config
- Bags which have gather mode enabled will display a flame icon to easily identify them
- Throwing a bag onto the ground will automatically toggle off gather mode
- Gather mode only moves newly added item stacks, so existing item stacks will be ignored, even when replenished
- When multiple bags are in gather mode, the plugin will attempt to add items to bags according to their order in the container
- When nesting bags and enabling gather mode at multiple levels, new items will recursively be moved to child bags until they cannot be moved further
Kit bags
A kit bag is a type of bag that only allows players to remove items from the bag, but not add items. Kit bags are intended to be used as a mechanism to give players multiple items at once, without requiring that the player initially have the inventory space to hold all the items, since the player only needs to be able to hold the bag itself. Also, for convenience, once a kit bag has been emptied, the bag will automatically delete itself since it is no longer useful at that point (since players cannot place items in it).How to redeem a kit as a bag:
If you have already created a kit via the Rust Kits plugin on uMod, you can give that kit to a player as a bag. That means the player will receive a bag item that is filled with the contents of that kit. To give a player a kit as a bag, simply run the command boh.givekitbag <player> kitbag.red.locked <kit>, where <player> should be replaced with a player name or steam ID, and <kit> should be replaced with the name of the kit. You may replace kitbag.red.locked with the name of a different locked kit bag if you want. Note: If running this command as a player (as opposed to in the server console or via another plugin), ensure you first have the bagofholding.givekitbag permission (caution: only grant that permission to trusted administrators).
Tip: If you want to allow players to store items in a bag that is redeemed this way, then simply use a bag profile which has the "Allow player item input" config option set to true.
How to add a kit bag to a kit:
The Rust Kits plugin on uMod supports bags with items in them. If you want to allow players to redeem kits that contain bags with items in them, simply create a bag, add the items you want, then create a kit from your inventory. Note: Players will not be able to see the contents of the bag from the Kits UI, so it will be a mystery to the player until they have redeemed the kit, though the Kits plugin might be updated in the future to allow inspecting bag contents.
If you want to add a bag to a kit, but don't want to allow players to use the bag as storage, follow the below steps create a kit bag.
- Give yourself an unlocked kit bag with the command boh.givebag <player> kitbag.red.unlocked, where <player> should be replaced with your user name or steam ID.
- Place items in the bag.
- Ensure you have the bagofholding.upgrade.kitbag.red.unlocked permission. Note: If you gave yourself a different color bag, the permission you must grant will be different. Caution: Only grant that permission to administrators who will be creating kits.
- Use the "Upgrade" feature to transform the bag into a kitbag.red.locked bag, which makes it so players can no longer add items to the bag.
- Use the Kits plugin to create or update the kit from your inventory.
- Redeem the kit.
- Ensure you have the bagofholding.upgrade.kitbag.red.locked permission. Note: If this is a different color bag, the permission you must grant will be different. Caution: Only grant that permission to administrators who will be creating kits.
- Use the "Upgrade" feature to transform the bag into a kitbag.red.unlocked bag.
- Update the items in the bag.
- Use the "Upgrade" feature to transform the bag back into a kitbag.red.locked bag, which makes it so players can no longer add items to the bag.
- Use the Kits plugin to update the kit from your inventory.