Skip to main content

daily-case-mod v2

Daily Case Mod

Welcome to the documentation for Daily Case Mod v2. This mod adds daily rewards and purchasable crates for Minecraft servers and now includes an in-game admin workflow for managing cases without manual JSON edits.

Overview

  • Daily Case: Players can open one case for free once per day (based on a server-side cooldown).
  • Shop boxes: Various boxes can be purchased in the shop with emeralds or other items and opened.
  • In-game preview: Players can right-click on a chest to see its possible contents before opening it.
  • Quick opening: The box opens quickly with a short animation effect.
  • Highly configurable: All aspects of the boxes (prices, odds, contents) can be customized via JSON and TOML files.
  • Admin Builder UI: OPs can create and edit cases using /daily admin (add/remove items, set icon, toggle shop visibility, rename by book).
  • Multiple languages: The user interface adapts to the client language (English and German).
  • Server-focused setup: Designed to run server-side with persistent config files in config/daily_case/.

What's New in v2

  • /daily admin (OP only): central admin menu for case management.
  • Create cases in-game: no manual file editing required for normal setup flows.
  • Add items from main hand: set rarity, weight, min/max count directly in the admin menu.
  • Rename cases via book: write the new case id on page 1 and apply in admin UI.
  • Localized admin UI: full English/German support for admin labels and feedback.

Installation

  1. Ensure that the appropriate Forge or NeoForge version is running on your server (1.20.1).
  2. Download the .jar file for the Daily Case Mod.
  3. Place the file in the mods folder of your server.
  4. Restart the server. On first start, default configuration files are created in config/daily_case/.
Important

In order for the daily cooldown to be saved correctly, the server must be shut down properly (not terminated abruptly).

Configuration

The mod is configured via files in the config/daily_case/ folder.

daily_case-common.toml

# Whether a message should be logged via a sample block (Dirt) (for debugging purposes)
logDirtBlock = true

# A magic number (currently without game functionality, probably also for debugging)
# Range: > 0
magicNumber = 42

# Introductory text for the magic number (output in logs)
magicNumberIntroduction = "The magic number is... "

# Cooldown time in hours between daily spins
# Range: 1 ~ 168 (corresponds to 1 week)
dailyCooldownHours = 1

# A list of items to be logged at startup (for debugging purposes)
items = ["minecraft:iron_ingot"]

Explanation of options

  • logDirtBlock: If true, a message about a dirt block is written to the log file when the game starts. Can be set to false.
  • magicNumber: Any numerical value. Currently, this has no effect on the mod's gameplay.
  • magicNumberIntroduction: A text that is written to the log file together with magicNumber. Can be changed.
  • dailyCooldownHours: Determines how many hours a player must wait before they can open the daily chest again. The default is 1 hour, and the maximum value is 168 (7 days).

case.json

This file defines all available crates, their respective properties, and contents. Each crate has its own definition within this main file.

{
"daily": {
"id": "daily",
"rarityChances": {
"legendary": 0.01,
"epic": 0.04,
"rare": 0.15,
"uncommon": 0.3,
"common": 0.5
},
"cooldownHours": 24,
"priceEmeralds": 0,
"priceItemId": "",
"priceItemCount": 0,
"shopItemId": "minecraft:chest",
"availableInShop": false,
"items": [
{
"id": "minecraft:iron_ingot",
"rarity": "common",
"weight": 50,
"minCount": 1,
"maxCount": 3,
"enchantments": ["minecraft:sharpness:1"]
}
// More items...
]
},
"premium": {
// Further box definitions...
}
}

Structure of a box

Each box is an object within the main JSON structure, where the name of the object (e.g., "daily") is the internal id value of the box.

  • id (string): A unique internal name for the box (e.g., daily, premium). Used internally by the mod.
  • rarityChances (object): Defines the base probability that an item of a certain rarity level will be selected. The values must be decimal numbers between 0 and 1 (e.g., 0.01 for 1%). The sum of all probabilities should equal 1.0 (e.g., 0.01 + 0.04 + 0.15 + 0.3 + 0.5 = 1.0). There are five clearly defined rarities: legendary, epic, rare, uncommon, common.
  • cooldownHours (Integer): Only relevant for boxes that are not the daily box (i.e., only shop boxes). Determines how many hours a player must wait before they can open this specific shop crate again. 0 means no cooldown. Instead, the value from daily_case-common.toml is used for the daily box.
  • priceEmeralds (Integer): Price in emeralds to purchase this chest. 0 means no emeralds are required.
  • priceItemId (string): Alternative item ID that is accepted as payment (e.g., minecraft:diamond). Leave blank ("") if only emeralds are to be used.
  • priceItemCount (Integer): Number of alternative items required as payment.
  • shopItemId (string): The item that is displayed in the shop GUI as an icon for this chest (e.g., minecraft:ender_chest for a premium chest).
  • availableInShop (Boolean): true: This box is available in the shop. false: This crate is not available in the shop (e.g., the daily crate).
  • items (Array of Objects): Defines the list of possible rewards inside this chest. Each element is an object with the format described under Items Format.

Items-Format (items.json)

This file (items.json) is not directly part of the main configuration case.json, but shows the internal format you must use for the items list of each box in case.json.

[
{
"id": "minecraft:iron_ingot",
"rarity": "common",
"weight": 50,
"minCount": 1,
"maxCount": 3,
"enchantments": ["minecraft:sharpness:1"] // Optional!
},
{
"id": "minecraft:gold_ingot",
"rarity": "common",
"weight": 35,
"minCount": 1,
"maxCount": 3
}
// More item definitions...
]

Structure of an item

  • id (string): The Minecraft ID of the item (e.g., minecraft:diamond, minecraft:iron_sword).
  • rarity (string): The rarity of this specific item. Must match one of the values from rarityChances of the surrounding chest (legendary, epic, rare, uncommon, common).
  • weight (integer): The weight influences the relative probability with which this specific item is selected within its own level. A higher weighting means a higher chance.
  • minCount (Integer): Minimum number of items given as a reward.
  • maxCount (integer): Maximum number of items given as a reward.
  • enchantments (array of strings - optional): If the item is to be enchanted, enter a list of enchantments here. Format: "modid:enchantment_id:level" (e.g., "minecraft:sharpness:5"). This is optional.

Example: Add new box

{
// Existing boxes such as "daily," "premium," etc. will remain unchanged...

"special": { // Internal ID of the new box
"id": "special",
"rarityChances": {
"legendary": 0.05,
"epic": 0.15,
"rare": 0.30,
"uncommon": 0.30,
"common": 0.20
},
"cooldownHours": 0, // No cooldown for this shop crate
"priceEmeralds": 50, // Cost: 50 emeralds
"priceItemId": "", // No alternative payment item
"priceItemCount": 0,
"shopItemId": "minecraft:beacon", // Displayed as a beacon in the shop
"availableInShop": true, // Available in store
"items": [ // Here comes the list of items in the same format as in items.json
{ "id": "minecraft:ender_pearl", "rarity": "common", "weight": 40, "minCount": 5, "maxCount": 10 },
{ "id": "minecraft:enchanted_golden_apple", "rarity": "rare", "weight": 15, "minCount": 1, "maxCount": 2 },
{ "id": "minecraft:elytra", "rarity": "epic", "weight": 8, "minCount": 1, "maxCount": 1 },
{ "id": "minecraft:dragon_egg", "rarity": "legendary", "weight": 1, "minCount": 1, "maxCount": 1 }
]
}
}

After making manual changes to case.json, restart the server for the changes to take effect. If you use the v2 admin menu, most case edits are written directly without manual file editing.

Use

  • Open player menu: Use /daily to open the daily/shop menu.
  • Open admin menu (OP): Use /daily admin to manage cases (create, edit, rename, icons, items).
  • Open daily chest: Select the daily chest from the menu and click on it. Once the cooldown has expired, the chest will open.
  • Buy/open a box in the shop: Select a shop box. You will see the price. If you have enough, click to buy and open it.
  • Show preview: Right-click on a box in the menu to see a preview of its possible contents.

Example Case.json file

Download the complete example file with all predefined boxes (daily, premium, vip, warrior, mage, builder, farmer, nether, end, ocean, mining, redstone, treasure, starter, explorer, adventure, artificer, elemental, enchanted_items):