Skip to content

Lootbags

Documentation for lootbags.json — configurable lootbag templates used as achievement rewards.

:::info Not the standalone Lootbag Mod This page documents the Core lootbag template system — simple reward containers used by Achievements and Quests. These are reward definitions, not droppable items.

For the standalone Lootbags mod with 120 collectible items, mob/block drops, themed families, and a reveal animation, see Lootbags Mod. :::

Lootbags are reward containers that players can open to receive items. Unlike direct item rewards, lootbags are stored as pending rewards and collected via the /rewards command.

Features:

  • Three lootbag types - Fixed items, random pool, or hybrid
  • Weighted randomization - Control item drop chances
  • Rarity system - Visual distinction by rarity tier
  • Auto-export - Default templates are created automatically

The lootbags.json file is automatically exported to your server config folder on first start:

Path: Server/Config/lootbags.json

After export, you can freely customize the file. The plugin will not overwrite your changes.


The player receives all defined items.

{
"welcome_gift": {
"name": "Welcome Gift",
"description": "A small starter pack for new players",
"icon": "Chest_Wood",
"rarity": "common",
"items": [
{ "itemId": "Food_Bread", "amount": 10 },
{ "itemId": "Torch", "amount": 16 },
{ "itemId": "Tool_Pickaxe_Wood", "amount": 1 }
]
}
}

The player receives X random items from a weighted pool.

{
"food_crate": {
"name": "Food Crate",
"description": "Provisions for your journey",
"icon": "Food_Bread",
"rarity": "common",
"pickCount": 3,
"allowDuplicates": true,
"pool": [
{ "itemId": "Food_Bread", "amount": 5, "weight": 50 },
{ "itemId": "Food_Apple", "amount": 8, "weight": 40 },
{ "itemId": "Food_Meat_Cooked", "amount": 3, "weight": 30 },
{ "itemId": "Potion_Health", "amount": 2, "weight": 10 }
]
}
}

The player receives guaranteed items plus X random items from the pool.

{
"playtime_gold": {
"name": "Gold Loyalty Reward",
"description": "For dedicated players",
"icon": "Ore_Gold",
"rarity": "rare",
"guaranteedItems": [
{ "itemId": "Ore_Gold", "amount": 25 }
],
"pickCount": 2,
"allowDuplicates": false,
"pool": [
{ "itemId": "Gem_Ruby", "amount": 1, "weight": 20 },
{ "itemId": "Gem_Emerald", "amount": 1, "weight": 20 },
{ "itemId": "Gem_Sapphire", "amount": 1, "weight": 20 },
{ "itemId": "Ore_Mithril", "amount": 5, "weight": 15 }
]
}
}

FieldTypeRequiredDescription
namestringYesDisplay name of the lootbag
descriptionstringYesDescription text
iconstringYesItem ID for the icon
raritystringNoRarity tier (see below)
itemsarrayNo*Fixed items (Type A)
guaranteedItemsarrayNo*Guaranteed items (Type C)
pickCountnumberNo*Number of random picks
allowDuplicatesbooleanNoAllow duplicate picks (default: false)
poolarrayNo*Pool for random picks
FieldTypeRequiredDescription
itemIdstringYesItem ID (e.g., Ore_Gold)
amountnumberNoQuantity (default: 1)
weightnumberNo*Weight for random selection
RarityColorTypical Use
commonGray (#AAAAAA)Starter rewards, simple achievements
uncommonGreen (#55FF55)Normal achievements
rareBlue (#5555FF)Difficult achievements
epicPurple (#AA00AA)Epic achievements
legendaryOrange (#FFAA00)End-game achievements

The plugin includes these pre-configured lootbags:

IDNameTypeRarity
starter_packStarter PackFixedcommon
miner_rewardMiner’s TreasureFixeduncommon
combat_lootWarrior’s CacheHybridrare
explorer_chestExplorer’s ChestRandomepic
legendary_hoardDragon’s HoardHybridlegendary
IDNameTypeRarity
copper_toolsCopper ToolsetFixeduncommon
iron_toolsIron ToolsetFixedrare
ore_bundle_commonOre Bundle (Basic)Fixedcommon
ore_bundle_rareOre Bundle (Rare)Fixedrare
ore_bundle_epicOre Bundle (Epic)Fixedepic
lumberjack_packLumberjack PackFixeduncommon
IDNameTypeRarity
food_crateFood CrateRandomcommon
builder_bundleBuilder BundleRandomuncommon
hunter_rewardHunter’s BountyRandomuncommon
social_giftSocial GiftFixedcommon
IDNameTypeRarity
playtime_bronzeBronze Loyalty RewardFixedcommon
playtime_silverSilver Loyalty RewardFixeduncommon
playtime_goldGold Loyalty RewardHybridrare

{
"id": "welcome",
"category": "social",
"iconItem": "Chest_Wood",
"difficulty": "easy",
"trigger": {
"type": "playtime_minutes",
"count": 1
},
"rewards": [
{ "type": "lootbag", "lootbagId": "welcome_gift" }
]
}

Localization:

achievements.name.welcome=Welcome!
achievements.desc.welcome=Play for 1 minute

For random pools, the probability of selecting an item is:

Probability = item_weight / total_weight

Example:

"pool": [
{ "itemId": "Food_Bread", "amount": 5, "weight": 50 }, // 50/130 = 38.5%
{ "itemId": "Food_Apple", "amount": 8, "weight": 40 }, // 40/130 = 30.8%
{ "itemId": "Food_Meat", "amount": 3, "weight": 30 }, // 30/130 = 23.1%
{ "itemId": "Potion_Health", "amount": 2, "weight": 10 } // 10/130 = 7.7%
]
// Total weight: 130

  1. Open Server/Config/lootbags.json
  2. Add your lootbag definition:
{
"existing_lootbags": { ... },
"my_custom_lootbag": {
"name": "My Custom Reward",
"description": "A special reward",
"icon": "Chest_Gold",
"rarity": "epic",
"guaranteedItems": [
{ "itemId": "Ore_Gold", "amount": 50 }
],
"pickCount": 3,
"allowDuplicates": false,
"pool": [
{ "itemId": "Gem_Diamond", "amount": 1, "weight": 10 },
{ "itemId": "Gem_Ruby", "amount": 2, "weight": 30 },
{ "itemId": "Gem_Emerald", "amount": 2, "weight": 30 },
{ "itemId": "Material_Gold", "amount": 10, "weight": 30 }
]
}
}
  1. Reference it in an achievement:
{
"rewards": [
{ "type": "lootbag", "lootbagId": "my_custom_lootbag" }
]
}
  1. Reload the plugin or restart the server

  1. Balance weights carefully - Very low weights may frustrate players
  2. Use appropriate rarities - Match rarity to achievement difficulty
  3. Consider duplicates - Set allowDuplicates: false for variety
  4. Test lootbags - Use admin commands to verify contents
  5. Descriptive names - Help players understand what they’re getting