DCEveryDayCase icon

DCEveryDayCase -----

DCEveryDayCase is an addon for the DonateCase plugin!



Code (Text):
DCEveryDayCase:
  case_settings:
    case_name: DCEveryDayCase
    keys_amount: 1
    claim_cooldown: 86400
    new_player_choice: case
    turn_off_daily_case_logic: false
  debug: false
  Languages: en_US
config:
    version: 1
    type: CONFIG

Configuration Structure

The configuration is divided into several main parts:

  • DCEveryDayCase: The root section containing all the plugin settings.

  • case_settings: A subsection with settings related to daily cases.

  • debug: A parameter to enable the debug mode.

  • Languages: Language selection for messages.
Now, let’s break down each parameter and its function.

Description of Configuration Parameters
1. case_settings
This section contains settings related to the logic of daily cases. Here are all the parameters in it:

  • case_name
    Type: String
    Default value: "DCEveryDayCase"
    Description: The name of the case used for daily rewards.
    How it works:
    This parameter defines which case from the DonateCase system will issue keys to players. For example, if you change the value to "MyCustomCase", the plugin will issue keys for a case with that name.
    Used in the DailyCaseService class to issue keys: dcapi.getCaseKeyManager().add(caseName, player, keysAmount).
    Example usage: If you have several cases in the game, you can specify a specific one, such as "DailyRewardCase".

  • keys_amount
    Type: Integer (int)
    Default value: 1
    Description: The number of keys a player receives for the daily reward.
    How it works:
    Determines how many keys a player gets each time they receive a daily reward. For example, if set to 2, the player will receive 2 keys.
    Applied in the giveGift method of the DailyCaseService class.
    Example usage: If you want to give out more keys (e.g., 3), just change this value.

  • claim_cooldown
    Type: Long integer (long)
    Default value: 86400 (24 hours in seconds)
    Description: Time in seconds between possible claims for a daily reward.
    How it works:
    Sets the interval at which a player can claim their reward again. For example, 86400 seconds equals 24 hours.
    Used in DailyCaseService to calculate the next claim time: nextClaimTimes.put(playerName, now + claimCooldown).
    Example usage: If you want the reward to be available every 12 hours, set it to 43200.

  • new_player_choice
    Type: String
    Default value: "case"
    Possible values: "case" or "timer"
    Description: Defines the behavior of the plugin for new players (those joining the game for the first time).
    How it works:
    • case: New players get a key immediately upon first login, and the timer starts after they open the case.

    • timer: New players do not get a key immediately, but the daily reward timer starts right away.
      The logic is implemented in the OpenCaseListener class in the onPlayerJoin method.
      Example usage: If you want new players to wait 24 hours before their first reward, choose "timer".
  • turn_off_daily_case_logic
    Type: Boolean
    Default value: false
    Description: Enables or disables the logic of daily cases.
    How it works:
    If set to true, the plugin will not issue keys or start timers automatically. However, if new_player_choice is set to "case", new players will still receive a key upon login, but without a timer.
    If set to false, the usual daily case logic will work.
    Checked in DailyCaseService and OpenCaseListener.
    Example usage: Set it to true if you want to temporarily disable daily rewards.
2. debug
  • Type: Boolean

  • Default value: false

  • Description: Enables or disables debug mode.

  • How it works:
    If set to true, the plugin will output additional messages to the console for tracking actions (e.g., saving time to the database or issuing keys).
    Used in various parts of the code, such as: if (addon.getConfig().isDebug()) logger.info("...").

  • Example usage: Enable it (true) if you need to diagnose issues with the plugin.
3. Languages
  • Type: String

  • Default value: "en_US"

  • Description: Language code for messages shown to players.

  • How it works:
    Determines which language file is loaded from the lang folder. For example, "en_US" loads the en_US.yml file.
    If the specified language is missing, the plugin defaults to "en_US" or creates an empty message object.
    Implemented in ConfigManager in the loadCurrentLanguage method.

  • Example usage: Change it to "ru_RU" if you want to use Russian (provided the ru_RU.yml file exists).
Supported Languages:

  • uk_UA: Ukrainian (uk_UA.yml)

  • ru_RU: Russian (ru_RU.yml)

  • en_US: English (en_US.yml)
These files are used for player-facing messages based on the Languages configuration parameter. If a specific language file is missing, the plugin defaults to en_US.

How the Parameters Affect the Plugin
Daily Case Behavior
  • case_name: Defines which case players will open with the keys they receive.

  • keys_amount: Controls how many keys are issued at a time.

  • claim_cooldown: Regulates the frequency of rewards issuance.

  • new_player_choice: Customizes the new player experience (immediate key or waiting time).

  • turn_off_daily_case_logic: Allows you to completely disable automatic key issuance and timers.
Debugging and Messages
  • debug: Helps developers or admins track the plugin’s actions.

  • Languages: Provides localization of messages for players.
Messages (From Language Files)
Although messages are not part of the config.yml, they are related to the Languages parameter and are loaded from the appropriate file (e.g., en_US.yml). Here’s their role:

  • available: Message when the case is available for claiming.

  • remaining: Shows the time until the next reward.

  • log_console_give_key: Console log when a key is issued.

  • info_placeholder: Message for placeholders if information is unavailable.

  • case_granted_on: Message when notifications are enabled.

  • case_granted_off: Message when notifications are disabled.

  • only_for_players: Message when the command is run by a non-player.

  • no_permission: Message about lack of permissions.

  • case_ready: Message when the case is ready for claiming.
These messages can be edited in language files, making the plugin flexible for different languages.

Conclusion
Your DCEveryDayCase plugin configuration allows you to customize:

  • Which case and how many keys are issued (case_name, keys_amount).

  • How often rewards are issued (claim_cooldown).

  • How new players are handled (new_player_choice).

  • Whether to enable daily case logic (turn_off_daily_case_logic).

  • Whether to display debug logs (debug).

  • Which language to use for messages (Languages).
Each parameter has a clear purpose and is integrated into the plugin’s code to provide flexibility and ease of use. If you have any additional questions or need example configurations, feel free to ask!


Example of a daily case in the case.yml file.
Code (YAML):
case:
   Animation
: WHEEL # BETTER_WHEEL
   Hologram
:
       Toggle
: true
       Height
: 1.9
       Range
: 30
       Message
:
      - '&cCases'
       - ''
       - '&a▼'
   OpenType
: GUI
   NoKeyActions
:
  - ' [message ] dont key'
   DisplayName
: 'Cases'
   Gui
:
       Title
: 'Cases'
       Size
: 54
       UpdateRate
: 20
       Items
:
           DCEveryDayCase
:
               Slots
:
              - 4
               Type
: OPEN_DCEveryDayCase
               Material
:
                   ID
: CHEST
                   DisplayName
: '&aDaily Case'
                   Enchanted
: false
                   Lore
:
                  - ''
                   - '&7A free case with various rewards.'
                   - ' %dceverydaycase_remaining_time%'
                   - ''
                   - § #FF6BA0Don’t know what you’ll get?
                   - § #CF6BFFTest your luck — your reward is waiting for you!
   CooldownBeforeAnimation
: 0
config
:
   version
: 13
   type
: OLD_CASE

 
Resource Information
Author:
----------
Total Downloads: 59
First Release: Apr 3, 2025
Last Update: Apr 7, 2025
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings